Skip to content

Is update() necessary only once, or prior to every call to a @requires_update method? #195

Closed Answered by rytilahti
heavydawson asked this question in Q&A
Discussion options

You must be logged in to vote

All properties marked with @requires_update do no I/O but use the results from the last update() call, so in order to get the most recent information you need to call it before accessing them. Alternatively, you can also use the methods that query the device for specific piece of information, e.g., get_emeter_realtime() (https://github.com/python-kasa/python-kasa/blob/master/kasa/smartdevice.py#L441). The latter also requires an initial update to find out if the device supports emeter.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rytilahti
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants