-
-
Notifications
You must be signed in to change notification settings - Fork 221
kasa.exceptions.SmartDeviceException: Communication error on system:set_relay_state #965
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
Comments
I've included here the output from those two print statements so that you can identify the hardware.
|
You have to run all I/O (i.e., commands that communicate with the device, accessing properties like The simplest way to fix this it to wrap your code inside a separate async function you execute using
|
Thank you. I wonder why none of the documentation shows a simple wrapping method like this? Here's the README I'm referring to. Click on the "Plugs" link and there's essentially a stub for the (deprecated) kasa.SmartPlug class. Select the Library Usage -> Getting Started menu item on the left. There is some REPL-related activities for discovering. Move on to the How-to Guides and look at the "Connect without discovery" option. I wouldn't call that a useful example. Visit the API Reference -> Device. Again, not very helpful. See, the problem I see as someone with more than four decades of experience is that everything worked just great about ten years ago coding to my TP-Link devices. I decided to use some code this week to remote control things on my solar system and suddenly everything has changed in that period of time. That is to be expected. I'm reasonably certain that the I would suggest minimally including an actual python script example for directing a single, known device to toggle ON or OFF. I'd also suggest to the coder in the README that the entire Thanks. I'll close this issue. I'm hoping that the docs get some McLovin. |
Agreed, the library is currently in flux but we have long planned to improve the docs for the next release (see #779 #755 #979). There is already an open PR by @sdb9696 to add some more documentation which should also help, feel free to take a look at let us know in the PR comments if you find something that feels odd: #968 Any help to improve the docs is also obviously welcome! :-) |
kasa, version 0.6.2.1
Exception: Communication error on system:set_relay_state
Python 3.9.7
MacOS 12.6.3
Example code:
If the plug is off then it simply displays the
print()
statement as expected. Uncommenting out the twoprint()
statements before this works as expected. If the plug is off then theturn_off()
method throws the exception as indicated. Adding a timeout of 20 seconds doesn't change this condition.Things work fine using the
kasa
CLI.The text was updated successfully, but these errors were encountered: