FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Exception running kasa command line with KL400L5(US) · Issue #307 · python-kasa/python-kasa · GitHub

Repository navigation

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

Closed

Description

$ 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'

Activity

  1. sleman commented on Feb 7, 2022

    Author

    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>
    
  2. rytilahti commented on Feb 7, 2022

    Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already exists

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL