This commit is contained in:
proddy
2025-12-24 16:59:18 +01:00
parent ac37ead419
commit a9511e6a29
8 changed files with 149 additions and 85 deletions

View File

@@ -289,11 +289,7 @@ void AnalogSensor::reload(bool get_nvs) {
uint8_t r = v / 10000;
uint8_t g = (v - r * 10000) / 100;
uint8_t b = v % 100;
#if ESP_ARDUINO_VERSION_MAJOR < 3
neopixelWrite(sensor.gpio(), 2 * r, 2 * g, 2 * b);
#else
rgbLedWrite(sensor.gpio(), 2 * r, 2 * g, 2 * b);
#endif
EMSESP_RGB_WRITE(sensor.gpio(), 2 * r, 2 * g, 2 * b);
LOG_DEBUG("RGB set to %d, %d, %d", r, g, b);
} else if (sensor.type() == AnalogType::DIGITAL_OUT) {
LOG_DEBUG("Digital Write on GPIO %02d", sensor.gpio());
@@ -955,11 +951,7 @@ bool AnalogSensor::command_setvalue(const char * value, const int8_t gpio) {
uint8_t r = v / 10000;
uint8_t g = (v - r * 10000) / 100;
uint8_t b = v % 100;
#if ESP_ARDUINO_VERSION_MAJOR < 3
neopixelWrite(sensor.gpio(), 2 * r, 2 * g, 2 * b);
#else
rgbLedWrite(sensor.gpio(), 2 * r, 2 * g, 2 * b);
#endif
EMSESP_RGB_WRITE(sensor.gpio(), 2 * r, 2 * g, 2 * b);
LOG_DEBUG("RGB set to %d, %d, %d", r, g, b);
} else if (sensor.type() == AnalogType::PULSE) {
uint8_t v = val;