Correct flash light livarno when use hue (#55294)

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
realPy 2021-08-27 18:25:27 +02:00 committed by GitHub
parent 3f2fad1a27
commit 7bd7d644a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -282,12 +282,14 @@ class HueLight(CoordinatorEntity, LightEntity):
self.is_osram = False self.is_osram = False
self.is_philips = False self.is_philips = False
self.is_innr = False self.is_innr = False
self.is_livarno = False
self.gamut_typ = GAMUT_TYPE_UNAVAILABLE self.gamut_typ = GAMUT_TYPE_UNAVAILABLE
self.gamut = None self.gamut = None
else: else:
self.is_osram = light.manufacturername == "OSRAM" self.is_osram = light.manufacturername == "OSRAM"
self.is_philips = light.manufacturername == "Philips" self.is_philips = light.manufacturername == "Philips"
self.is_innr = light.manufacturername == "innr" self.is_innr = light.manufacturername == "innr"
self.is_livarno = light.manufacturername.startswith("_TZ3000_")
self.gamut_typ = self.light.colorgamuttype self.gamut_typ = self.light.colorgamuttype
self.gamut = self.light.colorgamut self.gamut = self.light.colorgamut
_LOGGER.debug("Color gamut of %s: %s", self.name, str(self.gamut)) _LOGGER.debug("Color gamut of %s: %s", self.name, str(self.gamut))
@ -383,6 +385,8 @@ class HueLight(CoordinatorEntity, LightEntity):
"""Return the warmest color_temp that this light supports.""" """Return the warmest color_temp that this light supports."""
if self.is_group: if self.is_group:
return super().max_mireds return super().max_mireds
if self.is_livarno:
return 500
max_mireds = self.light.controlcapabilities.get("ct", {}).get("max") max_mireds = self.light.controlcapabilities.get("ct", {}).get("max")
@ -493,7 +497,7 @@ class HueLight(CoordinatorEntity, LightEntity):
elif flash == FLASH_SHORT: elif flash == FLASH_SHORT:
command["alert"] = "select" command["alert"] = "select"
del command["on"] del command["on"]
elif not self.is_innr: elif not self.is_innr and not self.is_livarno:
command["alert"] = "none" command["alert"] = "none"
if ATTR_EFFECT in kwargs: if ATTR_EFFECT in kwargs:
@ -532,7 +536,7 @@ class HueLight(CoordinatorEntity, LightEntity):
elif flash == FLASH_SHORT: elif flash == FLASH_SHORT:
command["alert"] = "select" command["alert"] = "select"
del command["on"] del command["on"]
elif not self.is_innr: elif not self.is_innr and not self.is_livarno:
command["alert"] = "none" command["alert"] = "none"
if self.is_group: if self.is_group: