fix flickering

This commit is contained in:
foosinn 2022-01-15 05:59:52 +01:00
parent badb30ae73
commit ec8996f7b4
2 changed files with 102 additions and 6 deletions

View file

@ -4,10 +4,11 @@ esphome:
board: nodemcuv2
on_boot:
priority: 300
then:
- light.turn_on:
id: bar
brightness: 20%
brightness: 100%
effect: meter
# Enable logging
@ -48,13 +49,13 @@ light:
effects:
- addressable_lambda:
name: "meter"
update_interval: 100ms
update_interval: 10ms
lambda: |-
int val = ((id(bme280_pressure).state - 900) * 0.08) - 4;
Color red = Color((uint8_t)255, (uint8_t)0, (uint8_t)0, (uint8_t)51);
Color yellow = Color((uint8_t)255, (uint8_t)255, (uint8_t)0, (uint8_t)51);
Color green = Color((uint8_t)0, (uint8_t)255, (uint8_t)0, (uint8_t)51);
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;
@ -92,4 +93,4 @@ sensor:
name: "BME280 Relative Humidity"
id: bme280_humidity
address: 0x76
update_interval: 5s
update_interval: .2s