-
Notifications
You must be signed in to change notification settings - Fork 2
/
indicators.yaml
60 lines (59 loc) · 1.74 KB
/
indicators.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# SPDX-License-Identifier: Apache-2.0
# Copyright (c) 2023 Ilia Sotnikov
---
esphome:
# Required for 'rp2040_pio_led_strip' component
min_version: '2023.6.2'
platformio_options:
build_flags:
# Define the preprocessor macro indicating presence of RGB led so that
# dependent code could be conditional
- '-DHAS_RGB_LED'
light:
- platform: rp2040_pio_led_strip
name: LED
internal: true
id: ${led_id}
pin: GPIO13
num_leds: 1
pio: 0
rgb_order: GRB
chipset: WS2812
effects:
- pulse:
name: pulse_1hz
transition_length: 1s
update_interval: 1s
- pulse:
name: pulse_2hz
transition_length: 0.2s
update_interval: 0.5s
- pulse:
name: pulse_slow
transition_length: 1s
update_interval: 2s
on_turn_on:
- lambda: |-
#include "esphome/components/sprinkler/sprinkler.h"
if (
id(lawn_sprinklers).controller_state()
!= esphome::sprinkler::SprinklerState::IDLE
|| id(flowerbed_sprinklers).controller_state()
!= esphome::sprinkler::SprinklerState::IDLE
) {
auto call = id(${led_id}).turn_on();
call.set_effect("pulse_2hz");
call.set_color_brightness(${led_brightness});
call.set_rgb(1.0, 0.4, 0.9);
call.perform();
return;
};
if (id(${rain_sensor_id}).state) {
auto call = id(${led_id}).turn_on();
call.set_effect("pulse_slow");
call.set_color_brightness(${led_brightness});
call.set_rgb(0.4, 1.0, 0.9);
call.perform();
return;
};
id(${led_id}).turn_on();