|
|
@ -33,22 +33,16 @@ binary_sensor: |
|
|
|
name: "Button" |
|
|
|
name: "Button" |
|
|
|
on_click: |
|
|
|
on_click: |
|
|
|
then: |
|
|
|
then: |
|
|
|
- switch.toggle: |
|
|
|
- lambda: | |
|
|
|
id: ledstring_switch |
|
|
|
std::string current = id(ledstring).get_effect_name(); |
|
|
|
|
|
|
|
std::vector<LightEffect *> effects = id(ledstring).get_effects(); |
|
|
|
switch: |
|
|
|
for(int i=0; i<effects.size(); i++) { |
|
|
|
- platform: template |
|
|
|
if(effects[i]->get_name().compare(current) == 0) { |
|
|
|
optimistic: True |
|
|
|
auto call = id(ledstring).turn_on(); |
|
|
|
id: ledstring_switch |
|
|
|
call.set_effect(effects[(i+1) % effects.size()]->get_name()); |
|
|
|
name: "LED String Switch" |
|
|
|
call.perform(); |
|
|
|
turn_on_action: |
|
|
|
} |
|
|
|
- light.turn_on: |
|
|
|
} |
|
|
|
id: ledstring |
|
|
|
|
|
|
|
brightness: 70% |
|
|
|
|
|
|
|
effect: rainbow |
|
|
|
|
|
|
|
turn_off_action: |
|
|
|
|
|
|
|
- light.turn_off: |
|
|
|
|
|
|
|
id: ledstring |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
light: |
|
|
|
light: |
|
|
|
- platform: neopixelbus |
|
|
|
- platform: neopixelbus |
|
|
|