From c6f48056fd0eb37f3553eacb57491a0a5fcbb113 Mon Sep 17 00:00:00 2001 From: Oxan van Leeuwen Date: Thu, 30 Sep 2021 12:12:37 +0200 Subject: [PATCH] Remove dead code from ESPHome light entity (#55519) --- homeassistant/components/esphome/light.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/homeassistant/components/esphome/light.py b/homeassistant/components/esphome/light.py index 9e7f544f610..b8fe4bd74c7 100644 --- a/homeassistant/components/esphome/light.py +++ b/homeassistant/components/esphome/light.py @@ -247,11 +247,6 @@ class EsphomeLight(EsphomeEntity[LightInfo, LightState], LightEntity): ) try_keep_current_mode = False - if self._supports_color_mode and color_modes: - # try the color mode with the least complexity (fewest capabilities set) - # popcount with bin() function because it appears to be the best way: https://stackoverflow.com/a/9831671 - color_modes.sort(key=lambda mode: bin(mode).count("1")) - data["color_mode"] = color_modes[0] if self._supports_color_mode and color_modes: if ( try_keep_current_mode