Fix ZHA color mode not being set correctly when changing light state (#74018)

This commit is contained in:
TheJulianJES 2022-06-28 15:53:00 +02:00 committed by GitHub
parent f3a24d5a45
commit ed7ea1423a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -262,6 +262,7 @@ class BaseLight(LogMixin, light.LightEntity):
if isinstance(result, Exception) or result[1] is not Status.SUCCESS:
self.debug("turned on: %s", t_log)
return
self._color_mode = ColorMode.COLOR_TEMP
self._color_temp = temperature
self._hs_color = None
@ -275,6 +276,7 @@ class BaseLight(LogMixin, light.LightEntity):
if isinstance(result, Exception) or result[1] is not Status.SUCCESS:
self.debug("turned on: %s", t_log)
return
self._color_mode = ColorMode.HS
self._hs_color = hs_color
self._color_temp = None