From 7f2cc47ed6c4fa7ef531da3d80066a4829e37430 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 20 Oct 2025 23:25:59 -1000 Subject: [PATCH 1/7] [binary_sensor] Add compile test for auto repeat (#11443) --- tests/components/binary_sensor/common.yaml | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tests/components/binary_sensor/common.yaml b/tests/components/binary_sensor/common.yaml index ed6322768f..6965c1feeb 100644 --- a/tests/components/binary_sensor/common.yaml +++ b/tests/components/binary_sensor/common.yaml @@ -37,3 +37,36 @@ binary_sensor: format: "New state is %s" args: ['x.has_value() ? ONOFF(x) : "Unknown"'] - binary_sensor.invalidate_state: some_binary_sensor + + # Test autorepeat with default configuration (no timings) + - platform: template + id: autorepeat_default + name: "Autorepeat Default" + filters: + - autorepeat: + + # Test autorepeat with single timing entry + - platform: template + id: autorepeat_single + name: "Autorepeat Single" + filters: + - autorepeat: + - delay: 2s + time_off: 200ms + time_on: 800ms + + # Test autorepeat with three timing entries + - platform: template + id: autorepeat_multiple + name: "Autorepeat Multiple" + filters: + - autorepeat: + - delay: 500ms + time_off: 50ms + time_on: 950ms + - delay: 2s + time_off: 100ms + time_on: 900ms + - delay: 10s + time_off: 200ms + time_on: 800ms From 3aedfe8be34d7fd7758d96fdc6e6ee95065fc705 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 20 Oct 2025 23:30:13 -1000 Subject: [PATCH 2/7] [binary_sensor] Optimize AutorepeatFilter with FixedVector (#11444) --- esphome/components/binary_sensor/__init__.py | 35 +++++++++++++------- esphome/components/binary_sensor/filter.cpp | 3 +- esphome/components/binary_sensor/filter.h | 11 ++---- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/esphome/components/binary_sensor/__init__.py b/esphome/components/binary_sensor/__init__.py index 6aa97d6e05..26e784a0b8 100644 --- a/esphome/components/binary_sensor/__init__.py +++ b/esphome/components/binary_sensor/__init__.py @@ -264,20 +264,31 @@ async def delayed_off_filter_to_code(config, filter_id): ), ) async def autorepeat_filter_to_code(config, filter_id): - timings = [] if len(config) > 0: - timings.extend( - (conf[CONF_DELAY], conf[CONF_TIME_OFF], conf[CONF_TIME_ON]) - for conf in config - ) - else: - timings.append( - ( - cv.time_period_str_unit(DEFAULT_DELAY).total_milliseconds, - cv.time_period_str_unit(DEFAULT_TIME_OFF).total_milliseconds, - cv.time_period_str_unit(DEFAULT_TIME_ON).total_milliseconds, + timings = [ + cg.StructInitializer( + cg.MockObj("AutorepeatFilterTiming", "esphome::binary_sensor::"), + ("delay", conf[CONF_DELAY]), + ("time_off", conf[CONF_TIME_OFF]), + ("time_on", conf[CONF_TIME_ON]), ) - ) + for conf in config + ] + else: + timings = [ + cg.StructInitializer( + cg.MockObj("AutorepeatFilterTiming", "esphome::binary_sensor::"), + ("delay", cv.time_period_str_unit(DEFAULT_DELAY).total_milliseconds), + ( + "time_off", + cv.time_period_str_unit(DEFAULT_TIME_OFF).total_milliseconds, + ), + ( + "time_on", + cv.time_period_str_unit(DEFAULT_TIME_ON).total_milliseconds, + ), + ) + ] var = cg.new_Pvariable(filter_id, timings) await cg.register_component(var, {}) return var diff --git a/esphome/components/binary_sensor/filter.cpp b/esphome/components/binary_sensor/filter.cpp index 3567e9c72b..8f31cf6fc2 100644 --- a/esphome/components/binary_sensor/filter.cpp +++ b/esphome/components/binary_sensor/filter.cpp @@ -1,7 +1,6 @@ #include "filter.h" #include "binary_sensor.h" -#include namespace esphome { @@ -68,7 +67,7 @@ float DelayedOffFilter::get_setup_priority() const { return setup_priority::HARD optional InvertFilter::new_value(bool value) { return !value; } -AutorepeatFilter::AutorepeatFilter(std::vector timings) : timings_(std::move(timings)) {} +AutorepeatFilter::AutorepeatFilter(std::initializer_list timings) : timings_(timings) {} optional AutorepeatFilter::new_value(bool value) { if (value) { diff --git a/esphome/components/binary_sensor/filter.h b/esphome/components/binary_sensor/filter.h index 16f44aa5fe..a7eb080feb 100644 --- a/esphome/components/binary_sensor/filter.h +++ b/esphome/components/binary_sensor/filter.h @@ -4,8 +4,6 @@ #include "esphome/core/component.h" #include "esphome/core/helpers.h" -#include - namespace esphome { namespace binary_sensor { @@ -82,11 +80,6 @@ class InvertFilter : public Filter { }; struct AutorepeatFilterTiming { - AutorepeatFilterTiming(uint32_t delay, uint32_t off, uint32_t on) { - this->delay = delay; - this->time_off = off; - this->time_on = on; - } uint32_t delay; uint32_t time_off; uint32_t time_on; @@ -94,7 +87,7 @@ struct AutorepeatFilterTiming { class AutorepeatFilter : public Filter, public Component { public: - explicit AutorepeatFilter(std::vector timings); + explicit AutorepeatFilter(std::initializer_list timings); optional new_value(bool value) override; @@ -104,7 +97,7 @@ class AutorepeatFilter : public Filter, public Component { void next_timing_(); void next_value_(bool val); - std::vector timings_; + FixedVector timings_; uint8_t active_timing_{0}; }; From 87e9a7a1bd8923b2ab0c36b0f8fb1cbc6ae01308 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 20 Oct 2025 23:35:18 -1000 Subject: [PATCH 3/7] [climate] Remove unnecessary vector allocations in state save/restore (#11445) --- esphome/components/climate/climate.cpp | 44 ++++++++++++++++++-------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/esphome/components/climate/climate.cpp b/esphome/components/climate/climate.cpp index 24a3fe6d5a..87d03f78c5 100644 --- a/esphome/components/climate/climate.cpp +++ b/esphome/components/climate/climate.cpp @@ -385,12 +385,14 @@ void Climate::save_state_() { if (!traits.get_supported_custom_fan_modes().empty() && custom_fan_mode.has_value()) { state.uses_custom_fan_mode = true; const auto &supported = traits.get_supported_custom_fan_modes(); - std::vector vec{supported.begin(), supported.end()}; - for (size_t i = 0; i < vec.size(); i++) { - if (vec[i] == custom_fan_mode) { + // std::set has consistent order (lexicographic for strings) + size_t i = 0; + for (const auto &mode : supported) { + if (mode == custom_fan_mode) { state.custom_fan_mode = i; break; } + i++; } } if (traits.get_supports_presets() && preset.has_value()) { @@ -400,12 +402,14 @@ void Climate::save_state_() { if (!traits.get_supported_custom_presets().empty() && custom_preset.has_value()) { state.uses_custom_preset = true; const auto &supported = traits.get_supported_custom_presets(); - std::vector vec{supported.begin(), supported.end()}; - for (size_t i = 0; i < vec.size(); i++) { - if (vec[i] == custom_preset) { + // std::set has consistent order (lexicographic for strings) + size_t i = 0; + for (const auto &preset : supported) { + if (preset == custom_preset) { state.custom_preset = i; break; } + i++; } } if (traits.get_supports_swing_modes()) { @@ -549,22 +553,34 @@ void ClimateDeviceRestoreState::apply(Climate *climate) { climate->fan_mode = this->fan_mode; } if (!traits.get_supported_custom_fan_modes().empty() && this->uses_custom_fan_mode) { - // std::set has consistent order (lexicographic for strings), so this is ok + // std::set has consistent order (lexicographic for strings) const auto &modes = traits.get_supported_custom_fan_modes(); - std::vector modes_vec{modes.begin(), modes.end()}; - if (custom_fan_mode < modes_vec.size()) { - climate->custom_fan_mode = modes_vec[this->custom_fan_mode]; + if (custom_fan_mode < modes.size()) { + size_t i = 0; + for (const auto &mode : modes) { + if (i == this->custom_fan_mode) { + climate->custom_fan_mode = mode; + break; + } + i++; + } } } if (traits.get_supports_presets() && !this->uses_custom_preset) { climate->preset = this->preset; } if (!traits.get_supported_custom_presets().empty() && uses_custom_preset) { - // std::set has consistent order (lexicographic for strings), so this is ok + // std::set has consistent order (lexicographic for strings) const auto &presets = traits.get_supported_custom_presets(); - std::vector presets_vec{presets.begin(), presets.end()}; - if (custom_preset < presets_vec.size()) { - climate->custom_preset = presets_vec[this->custom_preset]; + if (custom_preset < presets.size()) { + size_t i = 0; + for (const auto &preset : presets) { + if (i == this->custom_preset) { + climate->custom_preset = preset; + break; + } + i++; + } } } if (traits.get_supports_swing_modes()) { From 80265a6bd2ad9208b3fa0b0ee8137495b4aeb7f0 Mon Sep 17 00:00:00 2001 From: Petr Kejval Date: Tue, 21 Oct 2025 15:17:07 +0200 Subject: [PATCH 4/7] [sensor] Add optimistic option to heartbeat filter (#10993) Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Co-authored-by: J. Nick Koston --- esphome/components/sensor/__init__.py | 23 +++++++++++++++++++++- esphome/components/sensor/filter.cpp | 5 +++++ esphome/components/sensor/filter.h | 5 +++-- tests/components/template/common-base.yaml | 3 +++ 4 files changed, 33 insertions(+), 3 deletions(-) diff --git a/esphome/components/sensor/__init__.py b/esphome/components/sensor/__init__.py index e603896f6d..7e91bb83c4 100644 --- a/esphome/components/sensor/__init__.py +++ b/esphome/components/sensor/__init__.py @@ -28,6 +28,8 @@ from esphome.const import ( CONF_ON_RAW_VALUE, CONF_ON_VALUE, CONF_ON_VALUE_RANGE, + CONF_OPTIMISTIC, + CONF_PERIOD, CONF_QUANTILE, CONF_SEND_EVERY, CONF_SEND_FIRST_AT, @@ -644,10 +646,29 @@ async def throttle_with_priority_filter_to_code(config, filter_id): return cg.new_Pvariable(filter_id, config[CONF_TIMEOUT], template_) +HEARTBEAT_SCHEMA = cv.Schema( + { + cv.Required(CONF_PERIOD): cv.positive_time_period_milliseconds, + cv.Optional(CONF_OPTIMISTIC, default=False): cv.boolean, + } +) + + @FILTER_REGISTRY.register( - "heartbeat", HeartbeatFilter, cv.positive_time_period_milliseconds + "heartbeat", + HeartbeatFilter, + cv.Any( + cv.positive_time_period_milliseconds, + HEARTBEAT_SCHEMA, + ), ) async def heartbeat_filter_to_code(config, filter_id): + if isinstance(config, dict): + var = cg.new_Pvariable(filter_id, config[CONF_PERIOD]) + await cg.register_component(var, {}) + cg.add(var.set_optimistic(config[CONF_OPTIMISTIC])) + return var + var = cg.new_Pvariable(filter_id, config) await cg.register_component(var, {}) return var diff --git a/esphome/components/sensor/filter.cpp b/esphome/components/sensor/filter.cpp index e8d04d161b..65d8dea31c 100644 --- a/esphome/components/sensor/filter.cpp +++ b/esphome/components/sensor/filter.cpp @@ -372,8 +372,12 @@ optional HeartbeatFilter::new_value(float value) { this->last_input_ = value; this->has_value_ = true; + if (this->optimistic_) { + return value; + } return {}; } + void HeartbeatFilter::setup() { this->set_interval("heartbeat", this->time_period_, [this]() { ESP_LOGVV(TAG, "HeartbeatFilter(%p)::interval(has_value=%s, last_input=%f)", this, YESNO(this->has_value_), @@ -384,6 +388,7 @@ void HeartbeatFilter::setup() { this->output(this->last_input_); }); } + float HeartbeatFilter::get_setup_priority() const { return setup_priority::HARDWARE; } CalibrateLinearFilter::CalibrateLinearFilter(std::initializer_list> linear_functions) diff --git a/esphome/components/sensor/filter.h b/esphome/components/sensor/filter.h index 03a1e0f24c..ecd55308d1 100644 --- a/esphome/components/sensor/filter.h +++ b/esphome/components/sensor/filter.h @@ -396,15 +396,16 @@ class HeartbeatFilter : public Filter, public Component { explicit HeartbeatFilter(uint32_t time_period); void setup() override; - optional new_value(float value) override; - float get_setup_priority() const override; + void set_optimistic(bool optimistic) { this->optimistic_ = optimistic; } + protected: uint32_t time_period_; float last_input_; bool has_value_{false}; + bool optimistic_{false}; }; class DeltaFilter : public Filter { diff --git a/tests/components/template/common-base.yaml b/tests/components/template/common-base.yaml index ea812532d4..b873af5207 100644 --- a/tests/components/template/common-base.yaml +++ b/tests/components/template/common-base.yaml @@ -101,6 +101,9 @@ sensor: - filter_out: 10 - filter_out: !lambda return NAN; - heartbeat: 5s + - heartbeat: + period: 5s + optimistic: true - lambda: return x * (9.0/5.0) + 32.0; - max: window_size: 10 From 8e8a2bde95e306fd029e3c40abc2547c11a34a5b Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Tue, 21 Oct 2025 13:37:29 -0700 Subject: [PATCH 5/7] [light] Decouple AddressableLight and Light transition classes (#11166) Co-authored-by: J. Nick Koston --- esphome/components/light/addressable_light.cpp | 2 +- esphome/components/light/addressable_light.h | 4 ++-- esphome/components/light/light_transformer.h | 4 ++++ esphome/components/light/transformers.h | 6 +----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/esphome/components/light/addressable_light.cpp b/esphome/components/light/addressable_light.cpp index a8e0c7b762..cd83015ecb 100644 --- a/esphome/components/light/addressable_light.cpp +++ b/esphome/components/light/addressable_light.cpp @@ -62,7 +62,7 @@ void AddressableLightTransformer::start() { } optional AddressableLightTransformer::apply() { - float smoothed_progress = LightTransitionTransformer::smoothed_progress(this->get_progress_()); + float smoothed_progress = LightTransformer::smoothed_progress(this->get_progress_()); // When running an output-buffer modifying effect, don't try to transition individual LEDs, but instead just fade the // LightColorValues. write_state() then picks up the change in brightness, and the color change is picked up by the diff --git a/esphome/components/light/addressable_light.h b/esphome/components/light/addressable_light.h index 3e94a39745..c8ed4897fa 100644 --- a/esphome/components/light/addressable_light.h +++ b/esphome/components/light/addressable_light.h @@ -8,7 +8,7 @@ #include "esphome/core/defines.h" #include "light_output.h" #include "light_state.h" -#include "transformers.h" +#include "light_transformer.h" #ifdef USE_POWER_SUPPLY #include "esphome/components/power_supply/power_supply.h" @@ -103,7 +103,7 @@ class AddressableLight : public LightOutput, public Component { bool effect_active_{false}; }; -class AddressableLightTransformer : public LightTransitionTransformer { +class AddressableLightTransformer : public LightTransformer { public: AddressableLightTransformer(AddressableLight &light) : light_(light) {} diff --git a/esphome/components/light/light_transformer.h b/esphome/components/light/light_transformer.h index fb9b709187..a84183c03c 100644 --- a/esphome/components/light/light_transformer.h +++ b/esphome/components/light/light_transformer.h @@ -38,6 +38,10 @@ class LightTransformer { const LightColorValues &get_target_values() const { return this->target_values_; } protected: + // This looks crazy, but it reduces to 6x^5 - 15x^4 + 10x^3 which is just a smooth sigmoid-like + // transition from 0 to 1 on x = [0, 1] + static float smoothed_progress(float x) { return x * x * x * (x * (x * 6.0f - 15.0f) + 10.0f); } + /// The progress of this transition, on a scale of 0 to 1. float get_progress_() { uint32_t now = esphome::millis(); diff --git a/esphome/components/light/transformers.h b/esphome/components/light/transformers.h index 8d49acff97..71d41a66d3 100644 --- a/esphome/components/light/transformers.h +++ b/esphome/components/light/transformers.h @@ -50,15 +50,11 @@ class LightTransitionTransformer : public LightTransformer { if (this->changing_color_mode_) p = p < 0.5f ? p * 2 : (p - 0.5) * 2; - float v = LightTransitionTransformer::smoothed_progress(p); + float v = LightTransformer::smoothed_progress(p); return LightColorValues::lerp(start, end, v); } protected: - // This looks crazy, but it reduces to 6x^5 - 15x^4 + 10x^3 which is just a smooth sigmoid-like - // transition from 0 to 1 on x = [0, 1] - static float smoothed_progress(float x) { return x * x * x * (x * (x * 6.0f - 15.0f) + 10.0f); } - LightColorValues end_values_{}; LightColorValues intermediate_values_{}; bool changing_color_mode_{false}; From 9e693335b6ada2ddbfaba252831c48390ad56c1f Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 21 Oct 2025 10:50:29 -1000 Subject: [PATCH 6/7] [binary_sensor] Optimize MultiClickTrigger with FixedVector --- esphome/components/binary_sensor/automation.h | 8 +-- tests/components/binary_sensor/common.yaml | 66 +++++++++++++++++++ 2 files changed, 70 insertions(+), 4 deletions(-) diff --git a/esphome/components/binary_sensor/automation.h b/esphome/components/binary_sensor/automation.h index b46436dc41..0bc7b9acb3 100644 --- a/esphome/components/binary_sensor/automation.h +++ b/esphome/components/binary_sensor/automation.h @@ -2,11 +2,11 @@ #include #include -#include #include "esphome/core/component.h" #include "esphome/core/automation.h" #include "esphome/core/hal.h" +#include "esphome/core/helpers.h" #include "esphome/components/binary_sensor/binary_sensor.h" namespace esphome { @@ -92,8 +92,8 @@ class DoubleClickTrigger : public Trigger<> { class MultiClickTrigger : public Trigger<>, public Component { public: - explicit MultiClickTrigger(BinarySensor *parent, std::vector timing) - : parent_(parent), timing_(std::move(timing)) {} + explicit MultiClickTrigger(BinarySensor *parent, std::initializer_list timing) + : parent_(parent), timing_(timing) {} void setup() override { this->last_state_ = this->parent_->get_state_default(false); @@ -115,7 +115,7 @@ class MultiClickTrigger : public Trigger<>, public Component { void trigger_(); BinarySensor *parent_; - std::vector timing_; + FixedVector timing_; uint32_t invalid_cooldown_{1000}; optional at_index_{}; bool last_state_{false}; diff --git a/tests/components/binary_sensor/common.yaml b/tests/components/binary_sensor/common.yaml index 6965c1feeb..e3fd159b08 100644 --- a/tests/components/binary_sensor/common.yaml +++ b/tests/components/binary_sensor/common.yaml @@ -70,3 +70,69 @@ binary_sensor: - delay: 10s time_off: 200ms time_on: 800ms + + # Test on_multi_click with single click + - platform: template + id: multi_click_single + name: "Multi Click Single" + on_multi_click: + - timing: + - state: true + min_length: 50ms + max_length: 350ms + then: + - logger.log: "Single click detected" + + # Test on_multi_click with double click + - platform: template + id: multi_click_double + name: "Multi Click Double" + on_multi_click: + - timing: + - state: true + min_length: 50ms + max_length: 350ms + - state: false + min_length: 50ms + max_length: 350ms + - state: true + min_length: 50ms + max_length: 350ms + then: + - logger.log: "Double click detected" + + # Test on_multi_click with complex pattern (5 events) + - platform: template + id: multi_click_complex + name: "Multi Click Complex" + on_multi_click: + - timing: + - state: true + min_length: 50ms + max_length: 350ms + - state: false + min_length: 50ms + max_length: 350ms + - state: true + min_length: 50ms + max_length: 350ms + - state: false + min_length: 50ms + max_length: 350ms + - state: true + min_length: 50ms + then: + - logger.log: "Complex pattern detected" + + # Test on_multi_click with custom invalid_cooldown + - platform: template + id: multi_click_cooldown + name: "Multi Click Cooldown" + on_multi_click: + - timing: + - state: true + min_length: 100ms + max_length: 500ms + invalid_cooldown: 2s + then: + - logger.log: "Click with custom cooldown" From d6961610c7cc8126136757cda8e517d5efe73ca1 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 21 Oct 2025 11:10:02 -1000 Subject: [PATCH 7/7] [light] Replace std::vector with FixedVector in strobe and color_wipe effects --- .../light/addressable_light_effect.h | 6 +-- esphome/components/light/base_light_effects.h | 6 +-- tests/components/light/common.yaml | 40 +++++++++++++++++++ 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/esphome/components/light/addressable_light_effect.h b/esphome/components/light/addressable_light_effect.h index fcf76b3cb0..9caccad634 100644 --- a/esphome/components/light/addressable_light_effect.h +++ b/esphome/components/light/addressable_light_effect.h @@ -1,9 +1,9 @@ #pragma once #include -#include #include "esphome/core/component.h" +#include "esphome/core/helpers.h" #include "esphome/components/light/light_state.h" #include "esphome/components/light/addressable_light.h" @@ -113,7 +113,7 @@ struct AddressableColorWipeEffectColor { class AddressableColorWipeEffect : public AddressableLightEffect { public: explicit AddressableColorWipeEffect(const std::string &name) : AddressableLightEffect(name) {} - void set_colors(const std::vector &colors) { this->colors_ = colors; } + void set_colors(const std::initializer_list &colors) { this->colors_ = colors; } void set_add_led_interval(uint32_t add_led_interval) { this->add_led_interval_ = add_led_interval; } void set_reverse(bool reverse) { this->reverse_ = reverse; } void apply(AddressableLight &it, const Color ¤t_color) override { @@ -155,7 +155,7 @@ class AddressableColorWipeEffect : public AddressableLightEffect { } protected: - std::vector colors_; + FixedVector colors_; size_t at_color_{0}; uint32_t last_add_{0}; uint32_t add_led_interval_{}; diff --git a/esphome/components/light/base_light_effects.h b/esphome/components/light/base_light_effects.h index ff6cd1ccfe..c74d19fe14 100644 --- a/esphome/components/light/base_light_effects.h +++ b/esphome/components/light/base_light_effects.h @@ -1,9 +1,9 @@ #pragma once #include -#include #include "esphome/core/automation.h" +#include "esphome/core/helpers.h" #include "light_effect.h" namespace esphome { @@ -188,10 +188,10 @@ class StrobeLightEffect : public LightEffect { this->last_switch_ = now; } - void set_colors(const std::vector &colors) { this->colors_ = colors; } + void set_colors(const std::initializer_list &colors) { this->colors_ = colors; } protected: - std::vector colors_; + FixedVector colors_; uint32_t last_switch_{0}; size_t at_color_{0}; }; diff --git a/tests/components/light/common.yaml b/tests/components/light/common.yaml index d4f64dcdea..f807014065 100644 --- a/tests/components/light/common.yaml +++ b/tests/components/light/common.yaml @@ -123,3 +123,43 @@ light: red: 100% green: 50% blue: 50% + # Test StrobeLightEffect with multiple colors + - platform: monochromatic + id: test_strobe_multiple + name: Strobe Multiple Colors + output: test_ledc_1 + effects: + - strobe: + name: Strobe Multi + colors: + - state: true + brightness: 100% + duration: 500ms + - state: false + duration: 250ms + - state: true + brightness: 50% + duration: 500ms + # Test StrobeLightEffect with transition + - platform: rgb + id: test_strobe_transition + name: Strobe With Transition + red: test_ledc_1 + green: test_ledc_2 + blue: test_ledc_3 + effects: + - strobe: + name: Strobe Transition + colors: + - state: true + red: 100% + green: 0% + blue: 0% + duration: 1s + transition_length: 500ms + - state: true + red: 0% + green: 100% + blue: 0% + duration: 1s + transition_length: 500ms