You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spinoff of #575, I'm wondering if there are ways to further cut how frequently this gets reset. It currently gets reset when:
when the car starts charging: No harm in resetting it here
when TWCManager decides it needs to stop charging cars: Needs to be reset when actually stopped; do we need to reset all cars at this point?
on a policy change: This feels like a potential spot to examine; more below
when a car leaves home (location change): We'll never ask it to start charging while absent; perhaps we should setstopAsking here!
when a car arrives home: This is reasonable, but also, if the car returns home and is plugged in, shouldn't the first one catch this?
Two places I want to think about more:
On a policy change, there's not necessarily a need to reset unless the policy somehow "offers more" than the old policy. For example, charge limit changes don't use a simple boolean, they use the last limit the car knew about. When the limit goes up, it's worth waking the car to tell it. When the limit goes down, we let the car sleep, because reducing the charge limit will never enable the car to charge when it couldn't before.
For example, when we switch from a policy that offers variable power to a policy that offers zero power, there's no point in resetting stopAsking -- cars can't charge under the new policy. There might be value in making this one conditional on the old and new policy.
Similar to the charge limit, I wonder if we should cache why the last start command failed. If the command failed because the car was done charging, the car won't need more charge until the battery level goes down or the charge limit goes up. We have access to these two numbers; can we use that?
The text was updated successfully, but these errors were encountered:
Spinoff of #575, I'm wondering if there are ways to further cut how frequently this gets reset. It currently gets reset when:
stopAsking
here!Two places I want to think about more:
On a policy change, there's not necessarily a need to reset unless the policy somehow "offers more" than the old policy. For example, charge limit changes don't use a simple boolean, they use the last limit the car knew about. When the limit goes up, it's worth waking the car to tell it. When the limit goes down, we let the car sleep, because reducing the charge limit will never enable the car to charge when it couldn't before.
For example, when we switch from a policy that offers variable power to a policy that offers zero power, there's no point in resetting
stopAsking
-- cars can't charge under the new policy. There might be value in making this one conditional on the old and new policy.Similar to the charge limit, I wonder if we should cache why the last start command failed. If the command failed because the car was done charging, the car won't need more charge until the battery level goes down or the charge limit goes up. We have access to these two numbers; can we use that?
The text was updated successfully, but these errors were encountered: