TWCManager
TWCManager copied to clipboard
Useless start-charge commands
Related to #575 and saving our limited quota of commands.
Some of the cases where we treat a failed attempt to start charging as a non-failure, we could detect from the car data we're already querying and not issue the command in the first place. For example:
- It's typical for a car to refuse to charge because it's complete, especially when we attempt to restart it after it finishes its charge. Given that we're already querying the charge and charge limit, can we skip sending a charge command to cars where the charge level is >= the limit? Can we set
stopAsking
when a car was actively charging and stops spontaneously around the time we expected it to? - It's typical for a car to refuse to charge because it's not connected to a charging station. Given that the charge state exposes a Disconnected state, can we skip sending a charge command to cars that report they're not plugged in?