Fix colorTemperatureInKelvin in Alexa report when light is off (#27107)
* Fixes #26405 Return None if light state is off since attribute is unavailable, prevents property from being reported with invalid value of 0. * Update Test to check property is not reported when light state is off.pull/27140/head
parent
c43eeee62f
commit
9c1feacd47
|
@ -326,7 +326,7 @@ class AlexaColorTemperatureController(AlexaCapibility):
|
|||
return color_util.color_temperature_mired_to_kelvin(
|
||||
self.entity.attributes["color_temp"]
|
||||
)
|
||||
return 0
|
||||
return None
|
||||
|
||||
|
||||
class AlexaPercentageController(AlexaCapibility):
|
||||
|
|
|
@ -294,8 +294,8 @@ async def test_report_colored_temp_light_state(hass):
|
|||
)
|
||||
|
||||
properties = await reported_properties(hass, "light.test_off")
|
||||
properties.assert_equal(
|
||||
"Alexa.ColorTemperatureController", "colorTemperatureInKelvin", 0
|
||||
properties.assert_not_has_property(
|
||||
"Alexa.ColorTemperatureController", "colorTemperatureInKelvin"
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue