You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kasa, version 0.6.2.1
Exception: Communication error on system:set_relay_state
Python 3.9.7
MacOS 12.6.3
Example code:
import asyncio
from kasa import SmartPlug
from pprint import pformat as pf
charger = "192.168.11.65"
plug = SmartPlug(charger)
# plug.timeout = 20
asyncio.run(plug.update())
# print("Hardware: %s" % pf(plug.hw_info))
# print("Full sysinfo: %s" % pf(plug.sys_info))
if (plug.is_on):
asyncio.run(plug.turn_off())
else:
print("Plug was already OFF")
If the plug is off then it simply displays the print() statement as expected. Uncommenting out the two print() statements before this works as expected. If the plug is off then the turn_off() method throws the exception as indicated. Adding a timeout of 20 seconds doesn't change this condition.