Skip to content

Add KL125 definition#201

Closed
mdarnol wants to merge 3 commits intoGadgetReactor:masterfrom
mdarnol:add-kl125-bulb
Closed

Add KL125 definition#201
mdarnol wants to merge 3 commits intoGadgetReactor:masterfrom
mdarnol:add-kl125-bulb

Conversation

@mdarnol
Copy link
Copy Markdown

@mdarnol mdarnol commented Feb 23, 2021

Recently purchased some KL125s and noticed that they caused home assistant to crash because they were not defined and there was no default color temp

Product Link
https://www.kasasmart.com/us/products/smart-lighting/kasa-smart-light-bulb-multicolor-kl125

It says there that the color temp is 2500K-6500K (adjustable via app and cloud)

Reason for the PR

2021-02-23 00:21:44 ERROR (MainThread) [homeassistant.components.light] tplink: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 358, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 466, in async_device_update
    await task
  File "/usr/src/homeassistant/homeassistant/components/tplink/light.py", line 468, in async_update
    is_ready = await self.hass.async_add_executor_job(
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/components/tplink/light.py", line 248, in attempt_update
    self._light_features = self._get_light_features()
  File "/usr/src/homeassistant/homeassistant/components/tplink/light.py", line 289, in _get_light_features
    min_mireds = kelvin_to_mired(min_range)
  File "/usr/src/homeassistant/homeassistant/util/color.py", line 515, in color_temperature_kelvin_to_mired
    return math.floor(1000000 / kelvin_temperature)
ZeroDivisionError: division by zero

@coveralls
Copy link
Copy Markdown

coveralls commented Feb 23, 2021

Coverage Status

Coverage remained the same at 80.357% when pulling 0a3215b on mdarnol:add-kl125-bulb into e03c192 on GadgetReactor:master.

@rytilahti
Copy link
Copy Markdown
Collaborator

This library here is not maintained anymore even when it's still used by homeassistant. Could you please create a patch to https://github.com/python-kasa/python-kasa ? That library will replace pyhs100 when it gets to releasable state.

@mdarnol
Copy link
Copy Markdown
Author

mdarnol commented Feb 23, 2021

Just to create the loop, new PR is here: python-kasa/python-kasa#143

superm1 pushed a commit to superm1/pyHS100 that referenced this pull request Mar 22, 2021
Originally developed by GadgetReactor#201
superm1 pushed a commit to superm1/pyHS100 that referenced this pull request Mar 22, 2021
Based upon GadgetReactor#201 but
redone ontop of `goodbye_release`
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

Successfully merging this pull request may close these issues.

4 participants