Remove dead code from ESPHome light entity (#55519)

This commit is contained in:
Oxan van Leeuwen 2021-09-30 12:12:37 +02:00 committed by GitHub
parent d3b1ccb668
commit c6f48056fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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