Open goofy2k opened 1 year ago
After having a better look at the example code, I think I can define multiple p110 variables and use these in calls for handshake, login and getEnergyUsage or getDeviceInfo. I will give that a try.
for what its worth i shred some example code for working with multiple plugs here, maybe it will be a good starting block?
most of the code is in the formatting the returned data (for my personal tastes)
Great! That is exactly what I was thinking of.
Now I am wondering if it is possible to create an array of variables such as your p110 and login to them in a loop similar to yours.
Then either:
or (my preference, but don't know if it is possible)
login to all plugs as above
store the array of p110 variables
end the Python script
on the desired moments start an other script for retrieval of plug data, which....
gets the p110 variables from storage
collects and shares plug data
stops
Some things to check:
I did point out it was perhaps my first ever python script and that it was just a beginning point :)
On Thu, 2 Feb 2023 at 20:59, Goofy2k @.***> wrote:
Great! That is exactly what I was thinking of.
Now I am wondering if it is possible to create an array of variables such as your p110 and login to them in a loop similar to yours.
Then either:
- create a polling loop starting at returnedData.... which repeatedly polls all plugs without doing the login inside that loop
or (my preference, but don't know if it is possible)
-
login to all plugs as above
store the array of p110 variables
end the Python script
on the desired moments start an other script for retrieval of plug data, which....
gets the p110 variables from storage
collects and shares plug data
stops
— Reply to this email directly, view it on GitHub https://github.com/fishbigger/TapoP100/issues/98#issuecomment-1413456296, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACO4RXLN7DJOUBDCBQE7LR3WVOAORANCNFSM6AAAAAAUOKMJ64 . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Haha, nevertheless: thanks for your help !
I used the example from the README.md I notice that it takes a few seconds before the script returns the requested info. This could be due to the fact that logging in / hand-shaking takes some time.
What is a good way to poll a set of plugs?
Is there a way to keep each plug in the set logged in and perform other set/get tasks in a loop?