Closed jorgror closed 10 months ago
Actually, you can already poll for this data by using the charger->get_observations() method.
state_lifetimeEnergy and state_chargerOpMode are defined in const.py.
So something like
get_observations({ ChargerStreamData.state_lifetimeEnergy.value, ChargerStreamData.state_chargerOpMode.value })
would be equivalent to get both of those values in one API call.
Thanks for the quick reply.
There is a difference though. poll will make easee fetch a updated state from the charger. This call does not return a value, only a 202 that the request is sent to the charger. Thats why there is a 3 minute rate limit.
The new updated lifetime energy will be available with the code you suggested soon after the poll request. You can test this by first get_observations and check the timestamp. Then do a poll, wait a few moments and do another get_observations.
I see, then I misunderstood what the purpose is. I think using "poll" in this context is confusing. I see that Easee is doing that too, but I would like to some more descriptive name for our functions. Like force_update_lifetimeenergy().
Thanks for your comment. I have improved the code accordingly.
Merging (to be tested before release).
Note that I changed the name of one of the functions to force_update_opmode since I thought it was a bit redundant to have charger in the name. Released a new version now.
poll_lifetimeenergy and poll_chargeropmode is available in the API but was not implemented in the client.