diff --git a/poempl.yaml b/poempl.yaml index ea87c90..862f2c8 100644 --- a/poempl.yaml +++ b/poempl.yaml @@ -52,6 +52,11 @@ light: update_interval: 10ms lambda: |- int val = ((id(bme280_pressure).state - 900) * 0.08) - 4; + if (val < 0) { + val = 0; + } else if (val > 8) { + val = 8; + } Color red = Color((uint8_t)192, (uint8_t)0, (uint8_t)0, (uint8_t)255); Color yellow = Color((uint8_t)128, (uint8_t)128, (uint8_t)0, (uint8_t)255); diff --git a/poempl2.yaml b/poempl2.yaml index 2b1d286..cb6315d 100644 --- a/poempl2.yaml +++ b/poempl2.yaml @@ -4,6 +4,7 @@ esphome: board: nodemcuv2 on_boot: + priority: 300 then: - light.turn_on: id: bar @@ -48,13 +49,13 @@ light: effects: - addressable_lambda: name: "meter" - update_interval: 5ms + update_interval: 10ms lambda: |- int val = ((id(bme280_pressure).state - 900) * 0.08) - 4; - Color red = Color((uint8_t)51, (uint8_t)0, (uint8_t)0, (uint8_t)255); - Color yellow = Color((uint8_t)51, (uint8_t)51, (uint8_t)0, (uint8_t)255); - Color green = Color((uint8_t)0, (uint8_t)51, (uint8_t)0, (uint8_t)255); + Color red = Color((uint8_t)192, (uint8_t)0, (uint8_t)0, (uint8_t)255); + Color yellow = Color((uint8_t)128, (uint8_t)128, (uint8_t)0, (uint8_t)255); + Color green = Color((uint8_t)0, (uint8_t)192, (uint8_t)0, (uint8_t)255); it.range(0, 9) = Color::BLACK;