Skip to content
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

When to reset stopAskingToStartCharging? #590

Open
MikeBishop opened this issue Jun 14, 2024 · 0 comments
Open

When to reset stopAskingToStartCharging? #590

MikeBishop opened this issue Jun 14, 2024 · 0 comments

Comments

@MikeBishop
Copy link
Collaborator

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 set stopAsking 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant