diff --git a/esphome/components/light/addressable_light.cpp b/esphome/components/light/addressable_light.cpp index 2b28bd562c..f52f27c63d 100644 --- a/esphome/components/light/addressable_light.cpp +++ b/esphome/components/light/addressable_light.cpp @@ -65,21 +65,12 @@ void AddressableLightTransformer::start() { // at low values (e.g. gamma 2.8 pre-gamma values <27 round to stored 0, freezing progress). this->uniform_start_color_.reset(); if (this->light_.size() > 0) { - // Compare raw (post-gamma) bytes across LEDs for uniformity. This avoids N calls to the - // gamma-uncorrecting get_red/green/blue/white accessors, which would otherwise discourage - // the compiler from inlining them inside the apply() fallback path. - auto first = this->light_[0]; - uint8_t r_raw = first.get_red_raw(); - uint8_t g_raw = first.get_green_raw(); - uint8_t b_raw = first.get_blue_raw(); - uint8_t w_raw = first.get_white_raw(); + Color first = this->light_[0].get(); for (int32_t i = 1; i < this->light_.size(); i++) { - auto view = this->light_[i]; - if (view.get_red_raw() != r_raw || view.get_green_raw() != g_raw || view.get_blue_raw() != b_raw || - view.get_white_raw() != w_raw) + if (this->light_[i].get() != first) return; } - this->uniform_start_color_ = first.get(); + this->uniform_start_color_ = first; } }