working \o/
This commit is contained in:
parent
ec8996f7b4
commit
ddf33c62de
2 changed files with 10 additions and 4 deletions
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue