-
-
Notifications
You must be signed in to change notification settings - Fork 239
Closed
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation
Description
Here is a copy of my current code:
#!/usr/bin/env python3
from kasa import SmartPlug
import asyncio
import time
plug = SmartPlug("192.168.1.96")
while True:
asyncio.run(plug.update())
power = plug.emeter_realtime.power
print(power)
time.sleep(5)
This almost works, but I encounter "Detected protocol reuse between different event loop" and then it eventually errors out.
What is the proper way to update the emeter information every X seconds?
Polling devices and storing them in a database is probably one of the top reasons for using this library. It would be wonderful if more examples were added to the documentation to show how to poll every X seconds / minutes.
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentation