home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.14k stars 29.82k forks source link

Kasa Tp-Link Error After Recent Update #121224

Closed c0nstantinator closed 2 months ago

c0nstantinator commented 2 months ago

The problem

Three smart switches show an error: failed to set up. They are all available in the Kasa app but unavailable in HA. Logs below.

What version of Home Assistant Core has the issue?

2024.7.0

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Kasa TP-Link

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: config_entries.py:586
First occurred: 8:01:39 AM (9 occurrences)
Last logged: 8:24:27 AM

Error setting up entry Dinner Table Light KS225 for tplink
Error setting up entry Family Area Light KS225 for tplink
Error setting up entry Smart Switch KS225 for tplink
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/tplink/__init__.py", line 165, in async_setup_entry
    device: Device = await Device.connect(config=config)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/device.py", line 233, in connect
    return await connect(host=host, config=config)  # type: ignore[arg-type]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/device_factory.py", line 71, in connect
    return await _connect(config, protocol)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/kasa/device_factory.py", line 110, in _connect
    await device.update()
  File "/usr/local/lib/python3.12/site-packages/kasa/smart/smartdevice.py", line 181, in update
    module._post_update_hook()
  File "/usr/local/lib/python3.12/site-packages/kasa/smart/modules/lightpreset.py", line 39, in _post_update_hook
    if preset_states := self.data.get(state_key):
                        ^^^^^^^^^^^^^
AttributeError: 'SmartErrorCode' object has no attribute 'get'

Additional information

No response

c0nstantinator commented 2 months ago

IMG_2952

bdraco commented 2 months ago

dupe of https://github.com/home-assistant/core/issues/121202 which is fixed in 2024.7.1

c0nstantinator commented 2 months ago

dupe of #121202 which is fixed in 2024.7.1

Is this version released yet?

bdraco commented 2 months ago

should be tomorrow

home-assistant[bot] commented 2 months ago

Hey there @rytilahti, @sdb9696, mind taking a look at this issue as it has been labeled with an integration (tplink) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `tplink` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tplink` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tplink documentation tplink source (message by IssueLinks)

c0nstantinator commented 2 months ago

should be tomorrow

Sounds great. Thanks for the swift response!!