8000 SMART.TAPOHUB does not work with 0.7.0 dev2 · Issue #958 · python-kasa/python-kasa · GitHub
[go: up one dir, main page]

Skip to content

SMART.TAPOHUB does not work with 0.7.0 dev2 #958

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

Closed
ngaertner opened this issue Jun 6, 2024 · 4 comments · Fixed by #987
Closed

SMART.TAPOHUB does not work with 0.7.0 dev2 #958

ngaertner opened this issue Jun 6, 2024 · 4 comments · Fixed by #987
Labels
bug Something isn't working
Milestone

Comments

@ngaertner
Copy link

Hi,

i just tried 0.7.0 dev2 and i get the following error when i run the cli.

kasa --host 172.16.2.4 --username myuser --password mysecret --device-family SMART.TAPOHUB --debug

DEBUG:kasa.discover:[DISCOVERY] 172.16.2.4 >> {'system': {'get_sysinfo': None}} DEBUG:kasa.discover:Waiting a total of 5 seconds for responses... DEBUG:kasa.klaptransport:Created KLAP transport for 172.16.2.4 DEBUG:kasa.discover:[DISCOVERY] 172.16.2.4 << {'result': {'device_id': 'xxxxxxxxxxxxxxxxxxxxxx', 'owner': 'yyyyyyyyyyyyyyy', 'device_type': 'SMART.TAPOHUB', 'device_model': 'H100(EU)', 'ip': '172.16.2.4', 'mac': 'E4-FA-C4-6F-50-64', 'is_support_iot_cloud': True, 'obd_src': 'tplink', 'factory_default': False, 'mgt_encrypt_schm': {'is_support_https': False, 'encrypt_type': 'KLAP', 'http_port': 80, 'lv': 2}}, 'error_code': 0} DEBUG:kasa.device:Initializing 172.16.2.4 of type <class 'kasa.smart.smartdevice.SmartDevice'> == None - H100 == Host: 172.16.2.4 Port: 80 Device state: False == Generic information == Raised error: 'Time' Traceback (most recent call last): File "C:\Users\ngaer\AppData\Local\pypoetry\Cache\virtualenvs\python-kasa-1xz2jDJb-py3.12\Scripts\\kasa", line 6, in <module> sys.exit(cli()) ^^^^^ File "C:\Users\ngaer\AppData\Local\pypoetry\Cache\virtualenvs\python-kasa-1xz2jDJb-py3.12\Lib\site-packages\asyncclick\core.py", line 1205, in __call__ return anyio.run(self._main, main, args, kwargs, **opts) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ngaer\AppData\Local\pypoetry\Cache\virtualenvs\python-kasa-1xz2jDJb-py3.12\Lib\site-packages\anyio\_core\_eventloop.py", line 73, in run return async_backend.run(func, args, {}, backend_options) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ngaer\AppData\Local\pypoetry\Cache\virtualenvs\python-kasa-1xz2jDJb-py3.12\Lib\site-packages\anyio\_backends\_asyncio.py", line 2001, in run return runner.run(wrapper()) ^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ngaer\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ngaer\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\Users\ngaer\AppData\Local\pypoetry\Cache\virtualenvs\python-kasa-1xz2jDJb-py3.12\Lib\site-packages\anyio\_backends\_asyncio.py", line 1989, in wrapper return await func(*args) ^^^^^^^^^^^^^^^^^ File "C:\Users\ngaer\AppData\Local\pypoetry\Cache\virtualenvs\python-kasa-1xz2jDJb-py3.12\Lib\site-packages\asyncclick\core.py", line 1208, in _main return await main(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ngaer\AppData\Local\pypoetry\Cache\virtualenvs\python-kasa-1xz2jDJb-py3.12\Lib\site-packages\asyncclick\core.py", line 1120, in main rv = await self.invoke(ctx) ^^^^^^^^^^^^^^^^^^^^^^ File "C:\git\python-kasa-0.7.0.dev2\kasa\cli.py", line 140, in invoke _handle_exception(self._debug, exc) File "C:\git\python-kasa-0.7.0.dev2\kasa\cli.py", line 138, in invoke return await super().invoke(ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ngaer\AppData\Local\pypoetry\Cache\virtualenvs\python-kasa-1xz2jDJb-py3.12\Lib\site-packages\asyncclick\core.py", line 1717, in invoke rv = await super().invoke(ctx) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ngaer\AppData\Local\pypoetry\Cache\virtualenvs\python-kasa-1xz2jDJb-py3.12\Lib\site-packages\asyncclick\core.py", line 1485, in invoke return await ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ngaer\AppData\Local\pypoetry\Cache\virtualenvs\python-kasa-1xz2jDJb-py3.12\Lib\site-packages\asyncclick\core.py", line 824, in invoke rv = await rv ^^^^^^^^ File "C:\git\python-kasa-0.7.0.dev2\kasa\cli.py", line 417, in cli return await ctx.invoke(state) ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\ngaer\AppData\Local\pypoetry\Cache\virtualenvs\python-kasa-1xz2jDJb-py3.12\Lib\site-packages\asyncclick\core.py", line 824, in invoke rv = await rv ^^^^^^^^ File "C:\Users\ngaer\AppData\Local\pypoetry\Cache\virtualenvs\python-kasa-1xz2jDJb-py3.12\Lib\site-packages\asyncclick\core.py", line 824, in invoke rv = await rv ^^^^^^^^ File "C:\git\python-kasa-0.7.0.dev2\kasa\cli.py", line 666, in state echo(f"\tTime: {dev.time} (tz: {dev.timezone}") ^^^^^^^^ File "C:\git\python-kasa-0.7.0.dev2\kasa\smart\smartdevice.py", line 376, in time _timemod = self.modules[Module.Time] ~~~~~~~~~~~~^^^^^^^^^^^^^ KeyError: 'Time'

Best Regards,

Nico

@rytilahti
Copy link
Member

Try removing --device-family from the command and see if that works.

Looks like we broke something for that switch, as it works without it just fine for me.

@rytilahti rytilahti added the bug Something isn't working label Jun 6, 2024
@rytilahti rytilahti added this to the 0.7.0 milestone Jun 6, 2024
@ngaertner
Copy link
Author

Yes - leaving away device-family works, but I noticed that adding --json creates an empty output.
Is that correct?

@ngaertner
Copy link
Author

forget my comment about --json - it works. must have been a network issue

@rytilahti
Copy link
Member

Yeah, just tested that it works also here locally. We'll keep this issue open until we figure out how to fix the issue when the device family is defined.

Thanks a lot for testing, btw! Feel free to create separate issues for anything that seems to be broken :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0