Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error adding entities for domain light with platform tapo #14

Closed
Alexfarnstrom opened this issue Mar 17, 2021 · 3 comments
Closed

Error adding entities for domain light with platform tapo #14

Alexfarnstrom opened this issue Mar 17, 2021 · 3 comments

Comments

@Alexfarnstrom
Copy link

Pulled from Hacs.

Updated today to latest 51ff857 update and it proke my light, cant connect to it, get following error from Hass logs.

Logger: homeassistant.components.light
Source: util/color.py:517
Integration: Lampor (documentation, issues)
First occurred: 14:48:31 (2 occurrences)
Last logged: 14:48:31

Error adding entities for domain light with platform tapo
Error while setting up tapo platform for light
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 317, in async_add_entities
await asyncio.gather(*tasks)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 509, in _async_add_entity
await entity.add_to_platform_finish()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 530, in add_to_platform_finish
self.async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 295, in async_write_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 321, in _async_write_ha_state
attr.update(self.state_attributes or {})
File "/usr/src/homeassistant/homeassistant/components/light/init.py", line 481, in state_attributes
data[ATTR_COLOR_TEMP] = self.color_temp
File "/config/custom_components/tapo/light.py", line 66, in color_temp
return kelvin_to_mired(color_temp)
File "/usr/src/homeassistant/homeassistant/util/color.py", line 517, in color_temperature_kelvin_to_mired
return math.floor(1000000 / kelvin_temperature)
ZeroDivisionError: division by zero

@Alexfarnstrom
Copy link
Author

on line 66 and around i commented off (or what is called)
"

@Property

def color_temp(self):

color_temp = self._tapo_coordinator.data.color_temp

if color_temp is not None:

return kelvin_to_mired(color_temp)

"

it removed the posibility to change color, but the light is reachable from home assistant.

@petretiandrea
Copy link
Owner

I've updated right now, I think that this issue is fixed in this new version. Try it

@Alexfarnstrom
Copy link
Author

I can add the light without a problem now, color change doesnt work, but saw in another issue thread you will fix it in a few days, so closing the issue.
thanks and great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants