GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Individual commands do not work on discovered devices · Issue #71 · python-kasa/python-kasa

Individual commands do not work on discovered devices #71

New issue
Copy link
New issue
Copy link
Closed
#982
Closed
Individual commands do not work on discovered devices#71
#982
Copy link
Labels
bugSomething isn't workingSomething isn't working

Description

@laoshaw
laoshaw
opened on Jun 11, 2020
Issue body actions
No host name given, trying discovery..
Discovering devices for 3 seconds
== hs100a - HS100(US) ==
    Host: 192.168.10.127
    Device state: ON

    == Generic information ==
    Time:         2020-06-11 17:13:12
    Hardware:     2.0
    Software:     1.5.6 Build 191118 Rel.140307
    MAC (rssi):   XX:XX:XX:XX:XX:XX (-48)
    Location:     {'latitude': 304306, 'longitude': -978273}

    == Device specific information ==
    LED state: True
    On since: 2020-06-11 16:58:33.087466


Traceback (most recent call last):
  File "/home/userx/tmp/python/venv8/bin/kasa", line 8, in <module>
    sys.exit(cli())
  File "/home/userx/tmp/python/venv8/lib/python3.8/site-packages/asyncclick/core.py", line 799, in __call__
    return anyio.run(self._main, main, args, kwargs, backend=_anyio_backend)
  File "/home/userx/tmp/python/venv8/lib/python3.8/site-packages/anyio/__init__.py", line 68, in run
    return asynclib.run(func, *args, **backend_options)  # type: ignore
  File "/home/userx/tmp/python/venv8/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 99, in run
    raise exception
  File "/home/userx/tmp/python/venv8/lib/python3.8/site-packages/anyio/_backends/_asyncio.py", line 67, in wrapper
    retval = await func(*args)
  File "/home/userx/tmp/python/venv8/lib/python3.8/site-packages/asyncclick/core.py", line 802, in _main
    return await main(*args, **kwargs)
  File "/home/userx/tmp/python/venv8/lib/python3.8/site-packages/asyncclick/core.py", line 748, in main
    rv = await self.invoke(ctx)
  File "/home/userx/tmp/python/venv8/lib/python3.8/site-packages/asyncclick/core.py", line 1175, in invoke
    return await _process_result(await sub_ctx.command.invoke(sub_ctx))
  File "/home/userx/tmp/python/venv8/lib/python3.8/site-packages/asyncclick/core.py", line 994, in invoke
    return await ctx.invoke(self.callback, **ctx.params)
  File "/home/userx/tmp/python/venv8/lib/python3.8/site-packages/asyncclick/core.py", line 586, in invoke
    rv = callback(*args, **kwargs)
  File "/home/userx/tmp/python/venv8/lib/python3.8/site-packages/asyncclick/decorators.py", line 60, in new_func
    raise RuntimeError('Managed to invoke callback without a '
RuntimeError: Managed to invoke callback without a context object of type 'SmartDevice' existing

Activity

  1. laoshaw commented on Jun 11, 2020

    @laoshaw
    laoshaw
    on Jun 11, 2020
    Author
    More actions

    Actually, that happens to on and off too, I can get rid of the error with '--host IPAddr' however.

    Reacted by gpicc, Eric Winer, Julian Fessard and Alexis
  2. rytilahti commented on Jun 12, 2020

    @rytilahti
    rytilahti
    on Jun 12, 2020
    Member
    More actions

    The problem is that the given command is run separately from the type discovery, so there is no "device" object created for that. There are two potential solutions:

    1. Stop propagating the command when no type is defined, or
    2. Pass the list of devices to the command, which need to handle each found instance separately.

    I'm not sure what's the best approach here, but I'm leaning to the first one.

  3. rytilahti
    added
    bugSomething isn't workingSomething isn't working
    on Jun 12, 2020
  4. rytilahti
    changed the title [-]HS100 python 3.8 sysinfo error[/-] [+]Individual commands do not work on discovered devices[/+] on Nov 25, 2020
  5. bmbouter commented on Feb 4, 2021

    @bmbouter
    bmbouter
    on Feb 4, 2021
    More actions

    The problem is that the given command is run separately from the type discovery, so there is no "device" object created for that. There are two potential solutions:

    1. Stop propagating the command when no type is defined, or
    
    2. Pass the list of devices to the command, which need to handle each found instance separately.
    

    I'm not sure what's the best approach here, but I'm leaning to the first one.

    Could you put some links into the relevant parts of the code for me to look at?

  6. rytilahti commented on Feb 7, 2021

    @rytilahti
    rytilahti
    on Feb 7, 2021
    Member
    More actions

    See #127 (comment) .

  7. DanielJoyce commented on Jun 13, 2021

    @DanielJoyce
    DanielJoyce
    on Jun 13, 2021
    More actions

    So none of the on/off and other commands work? I'm using the master branch

  8. lyricnz commented on Aug 21, 2022

    @lyricnz
    lyricnz
    on Aug 21, 2022
    More actions

    I have some error output, running "kasa emeter" from CLI. My first switch, which has power-monitoring, works fine. The second emits this error. Seems some check needs to be made for feature missing from device?

  9. sdb9696
    closed this as completedin #982on Jun 17, 2024
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

    bugSomething isn't workingSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.