-
Notifications
You must be signed in to change notification settings - Fork 61
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
Check sleep state before polling #18
Comments
Thanks. This parameter may make sense. We're actually fixing a bug(#16) where it's not being woken up enough but that will only increase the vampire drain you're discussing here so there's a balance we need to strike. As a note, I also had the phantom drain problem and put in a fix to create an update switch in HA (#8) that may provide some relief. I couldn't push it in because the pypi package wasn't updated, but I recently got contributor rights so we can probably push it in after we resolve #16. |
Adding the switch is better than nothing, but it still requires the user to manually turn if off so it won't wake. The proper solution is to check the |
Agree with your point. However, as this is an API fix, someone has to change all the calling functions to pass the flag which is slightly harder than a user manually flipping it in HA. I've created the flag and testing it now. |
I haven't seen that but the current code treats the empty state as offline. We can see if that induces any unexpected bugs. |
When using the API to poll the car, if the car is asleep, it will be woken. When using teslajsonpy with things like HomeAssistant where it periodiclaly polls to make graphs of the battery level for example, it keeps waking the car to get the battery status. This results in large 'vampire drain' when the car is sitting idle (overnight, while owner is at work, etc.).
Could a flag be added to the API to tell it what to do if the car was asleep?
Something like:
Where
wake_if_asleep
is eitherTrue
(should be default to preserve current behavior) orFalse
. If set toFalse
and the vehicle is asleep, the call return value should be something that could be easily checked.How to check:
The data returned from
/api/1/vehicles/{id}
includes astate
key which is eitheronline
orasleep
- this call should NOT wake the vehicle and allows checking first.The text was updated successfully, but these errors were encountered: