Skip to content
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

Need assistance on getting status updates #177

Open
k5map opened this issue Apr 5, 2023 · 4 comments
Open

Need assistance on getting status updates #177

k5map opened this issue Apr 5, 2023 · 4 comments

Comments

@k5map
Copy link

k5map commented Apr 5, 2023

@arraylabs ... very much appreciate your Python library. I've been monitoring the "hjdhjd/myq" app but am not proficient in JS or TS or yours is best solution for me.

I've successfully written a short app to get the status of my MyQ devices using the sample code in the readme. Now I'd like to do a loop to monitor the status of my devices (every 5-10 seconds). Since I've executed the login function and assigned it to a var, what function must I use to refresh the status of my devices?

@k5map k5map changed the title Need assistance on get status updates Need assistance on getting status updates Apr 5, 2023
@Goose66
Copy link

Goose66 commented Apr 6, 2023

Use the api.update_device_info() method to update the status of all devices. Note that this is throttled in frequency to once every 5 seconds in the code. However, in my opinion performing status polling every 5 seconds over a long period is too frequent and will eventually result in Chamberlain throttling or suspending your account or potentially altering or shutting down the interface.

@k5map
Copy link
Author

k5map commented Apr 6, 2023

@Goose66
Much thanks for the update_device_info() info... I've been reading the post on @hjdhjd/myq's Github so was aware of not calling it frequently to avoid Chamberlain from blacklisting my IP but still appreciate the heads up.

@k5map
Copy link
Author

k5map commented Apr 6, 2023

@Goose66
I have one additional question... am I able to call update_device_info() repeatedly without having to login again? My concern is after x amount of time, does my login credentials expire.

@Goose66
Copy link

Goose66 commented Jul 15, 2023

When the api object initially authorizes through oAuth, it receives a token TTL value ("expires_in") from the MyQ service. I believe the api object keeps up with this and refreshes the token as needed as long as the api object is alive. My implementation (which is different from pymyq) uses a default token TTL of 60 min.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants