diff --git a/esphomeyaml/components/light/index.rst b/esphomeyaml/components/light/index.rst index 3fe7a8b32..614a41d1e 100644 --- a/esphomeyaml/components/light/index.rst +++ b/esphomeyaml/components/light/index.rst @@ -278,15 +278,19 @@ This effect allows you to write completely custom light effects yourself using : update_interval: 1s lambda: |- static int state = 0; + auto call = id(my_light).turn_on(); + // Transtion of 1000ms = 1s + call.set_transition_length(1000); if (state == 0) { - id(my_light).start_transition(light::LightColorValues::from_rgb(1.0, 1.0, 1.0))); + call.set_rgb(1.0, 1.0, 1.0); } else if (state == 1) { - id(my_light).start_transition(light::LightColorValues::from_rgb(1.0, 0.0, 1.0))); + call.set_rgb(1.0, 0.0, 1.0); } else if (state == 2) { - id(my_light).start_transition(light::LightColorValues::from_rgb(0.0, 0.0, 1.0))); + call.set_rgb(0.0, 0.0, 1.0); } else { - id(my_light).start_transition(light::LightColorValues::from_rgb(0.0, 0.0, 0.0))); + call.set_rgb(1.0, 0.0, 0.0); } + call.execute(); state += 1; if (state == 4) state = 0;