-
-
Notifications
You must be signed in to change notification settings - Fork 227
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
I get an error when I try to connect to my TP-Link L920-5 Smart LED Strip with the kasa
python CLI tool.
I first discovered the issue in Home Assistant's TP-Link Smart Home integration after upgrading to Core version 2024.7.0
, so I started investigating, found the phython-kasa library, tried to use the kasa discover
command and got exactly the same error as I got in Home Assistant.
Raised error: 'brightness'
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Python312\Scripts\kasa.exe\__main__.py", line 7, in <module>
File "C:\Python312\Lib\site-packages\asyncclick\core.py", line 1205, in __call__
return anyio.run(self._main, main, args, kwargs, **opts)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\anyio\_core\_eventloop.py", line 74, in run
return async_backend.run(func, args, {}, backend_options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\anyio\_backends\_asyncio.py", line 2034, in run
return runner.run(wrapper())
^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\anyio\_backends\_asyncio.py", line 2022, in wrapper
return await func(*args)
^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\asyncclick\core.py", line 1208, in _main
return await main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\asyncclick\core.py", line 1120, in main
rv = await self.invoke(ctx)
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\kasa\cli.py", line 145, in invoke
_handle_exception(self._debug, exc)
File "C:\Python312\Lib\site-packages\kasa\cli.py", line 143, in invoke
return await super().invoke(ctx)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\asyncclick\core.py", line 1739, in invoke
return await _process_result(await sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\asyncclick\core.py", line 1485, in invoke
return await ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\asyncclick\core.py", line 824, in invoke
rv = await rv
^^^^^^^^
File "C:\Python312\Lib\site-packages\kasa\cli.py", line 515, in discover
discovered_devices = await Discover.discover(
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python312\Lib\site-packages\kasa\discover.py", line 364, in discover
await protocol.wait_for_discovery_to_complete()
File "C:\Python312\Lib\site-packages\kasa\discover.py", line 190, in wait_for_discovery_to_complete
await asyncio.gather(*self.callback_tasks)
File "C:\Python312\Lib\site-packages\kasa\cli.py", line 503, in print_discovered
await dev.update()
File "C:\Python312\Lib\site-packages\kasa\smart\smartdevice.py", line 181, in update
module._post_update_hook()
File "C:\Python312\Lib\site-packages\kasa\smart\modules\lightpreset.py", line 45, in _post_update_hook
brightness=preset_state["brightness"],
~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'brightness'
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001982F04A900>
ERROR:asyncio:Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x000001982F20E8D0>, 1165.781)]']
connector: <aiohttp.connector.TCPConnector object at 0x000001982F075370>
ERROR:asyncio:Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x000001982F17C6B0>
ERROR:asyncio:Unclosed connector
connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0x000001982F20E930>, 1166.203)]']
connector: <aiohttp.connector.TCPConnector object at 0x000001982F28C3B0>
I already raised the issue at the Home Assistant side, but I thought I'll raise it here as well, I hope that is okay. Please let me know if you need any more information, I would gladly provide my help to resolve this issue! 😄
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working