-
Notifications
You must be signed in to change notification settings - Fork 142
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
How to work with multiple plugs? #98
Comments
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)
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
<#98 (comment)>,
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?
The text was updated successfully, but these errors were encountered: