core: Exception in Google Assistant with ESPHome binary light in 2021.4.3
The problem
Repro:
- Use a ESPHome 1.16.2
binary light
; https://esphome.io/components/light/binary.html. In the logs below,light.tour_eiffel
is a binary light. - Use google assistant integration.
- Restart home assistant.
Actual:
2021-04-11 19:37:24 ERROR (MainThread) [homeassistant.components.google_assistant.smart_home] Error serializing light.tour_eiffel
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/google_assistant/helpers.py", line 517, in sync_serialize
device["attributes"].update(trt.sync_attributes())
File "/usr/src/homeassistant/homeassistant/components/google_assistant/trait.py", line 385, in sync_attributes
"temperatureMaxK": color_util.color_temperature_mired_to_kelvin(
File "/usr/src/homeassistant/homeassistant/util/color.py", line 513, in color_temperature_mired_to_kelvin
return math.floor(1000000 / mired_temperature)
ZeroDivisionError: float division by zero
https://github.com/home-assistant/core/blob/2021.4.3/homeassistant/components/google_assistant/trait.py#L381 The light doesn’t support color temperature, so it’s not expected that this condition is true.
What is version of Home Assistant Core has the issue?
core-2021.4.3
What was the last working version of Home Assistant Core?
core-2021.3.4
What type of installation are you running?
Home Assistant Container
Integration causing the issue
google_assistant
Link to integration documentation on our website
https://www.home-assistant.io/integrations/google_assistant/
Example YAML snippet
The esphome yaml file:
(...)
light:
- platform: binary
name: "Tour Eiffel"
id: lumieres_2
output: output_2
output:
- platform: esp8266_pwm
id: output_2
pin: D3
### Anything in the logs that might be useful for us?
_No response_
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 20 (8 by maintainers)
Update:
monochromatic
light. So this rules out that this is caused bybinary
.