8000 Exception running kasa command line with KL400L5(US) · Issue #307 · python-kasa/python-kasa · GitHub
[go: up one dir, main page]

Skip to content

Exception running kasa command line with KL400L5(US) #307

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
sleman opened this issue Feb 7, 2022 · 2 comments
Closed

Exception running kasa command line with KL400L5(US) #307

sleman opened this issue Feb 7, 2022 · 2 comments
Labels
duplicate This issue or pull request already exists

Comments

@sleman
Copy link
sleman commented Feb 7, 2022
$ kasa --version
kasa, version 0.4.1

$ kasa
No host name given, trying discovery..
Discovering devices on 255.255.255.255 for 3 seconds

== ledstrip - KL400L5(US) ==
	Host: 10.90.7.106
	Device state: ON

	== Generic information ==
	Time:         2022-02-06 22:02:24
	Hardware:     1.0
	Software:     1.0.8 Build 211018 Rel.162056
	MAC (rssi):   xx:xx:xx:xx:xx:xx (-59)
	Location:     {'latitude': xxxxx, 'longitude': xxxxx}

	== Device specific information ==
	Brightness: 100
	Is dimmable: True
	HSV: HSV(hue=344, saturation=100, value=100)
	Length: 1


	== Current State ==
Traceback (most recent call last):
  File "/opt/homebrew/bin/kasa", line 8, in <module>
    sys.exit(cli())
  File "/opt/homebrew/lib/python3.9/site-packages/asyncclick/core.py", line 1150, in __call__
    return anyio.run(self._main, main, args, kwargs, **({"backend":_anyio_backend} if _anyio_backend is not None else {}))
  File "/opt/homebrew/lib/python3.9/site-packages/anyio/_core/_eventloop.py", line 56, in run
    return asynclib.run(func, *args, **backend_options)
  File "/opt/homebrew/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 233, in run
    return native_run(wrapper(), debug=debug)
  File "/opt/homebrew/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/opt/homebrew/Cellar/python@3.9/3.9.10/Frameworks/Python.framework/Versions/3.9/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/opt/homebrew/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 228, in wrapper
    return await func(*args)
  File "/opt/homebrew/lib/python3.9/site-packages/asyncclick/core.py", line 1153, in _main
    return await main(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/asyncclick/core.py", line 1074, in main
    rv = await self.invoke(ctx)
  File "/opt/homebrew/lib/python3.9/site-packages/asyncclick/core.py", line 1662, in invoke
    await super().invoke(ctx)
  File "/opt/homebrew/lib/python3.9/site-packages/asyncclick/core.py", line 1420, in invoke
    return await ctx.invoke(self.callback, **ctx.params)
  File "/opt/homebrew/lib/python3.9/site-packages/asyncclick/core.py", line 774, in invoke
    rv = await rv
  File "/opt/homebrew/lib/python3.9/site-packages/kasa/cli.py", line 82, in cli
    await ctx.invoke(discover)
  File "/opt/homebrew/lib/python3.9/site-packages/asyncclick/core.py", line 774, in invoke
    rv = await rv
  File "/opt/homebrew/lib/python3.9/site-packages/kasa/cli.py", line 162, in discover
    await ctx.invoke(state)
  File "/opt/homebrew/lib/python3.9/site-packages/asyncclick/core.py", line 774, in invoke
    rv = await rv
  File "/opt/homebrew/lib/python3.9/site-packages/asyncclick/core.py", line 774, in invoke
    rv = await rv
  File "/opt/homebrew/lib/python3.9/site-packages/kasa/cli.py", line 231, in state
    emeter_status = dev.emeter_realtime
  File "/opt/homebrew/lib/python3.9/site-packages/kasa/smartdevice.py", line 87, in wrapped
    return f(*args, **kwargs)
  File "/opt/homebrew/lib/python3.9/site-packages/kasa/smartdevice.py", line 432, in emeter_realtime
    return EmeterStatus(self._last_update[self.emeter_type]["get_realtime"])
KeyError: 'smartlife.iot.common.emeter'
@sleman
Copy link
Author
sleman commented Feb 7, 2022

Connecting with IP address does not throw exception.

$ kasa --host 10.90.7.106
No --type defined, discovering..
== ledstrip - KL400L5(US) ==
	Host: 10.90.7.106
	Device state: ON

	== Generic information ==
	Time:         2022-02-06 22:06:36
	Hardware:     1.0
	Software:     1.0.8 Build 211018 Rel.162056

	== Device specific information ==
	Brightness: 100
	Is dimmable: True
	HSV: HSV(hue=344, saturation=100, value=100)
	Length: 1


	== Current State ==
	<EmeterStatus power=10.8 voltage=None current=None total=0.032>

@rytilahti
Copy link
Member
rytilahti commented Feb 7, 2022

Duplicate of #302, this should be fixed already in master with #303.

@rytilahti rytilahti added the duplicate This issue or pull request already exists label Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants
0