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

Reset vehicle cache when charging stops for last soc update #7238

Merged
merged 1 commit into from
Apr 6, 2023

Conversation

andig
Copy link
Member

@andig andig commented Apr 5, 2023

Refs #7032 (comment)

Note: this will reset all vehicles; but that seems acceptable at this stage.

@andig andig added the enhancement New feature or request label Apr 5, 2023
@andig andig requested a review from premultiply April 5, 2023 14:38
@premultiply
Copy link
Member

Das betrifft dann aber nur die momentan verbundenen bzw. einem LP zugeordneten Fahrzeuge, oder?

@andig
Copy link
Member Author

andig commented Apr 5, 2023

Alle. Genau genommen jegliche Verwendung von ResettableCached im Code.

@premultiply
Copy link
Member

Mmmmh. Nicht dass dann im Zweifelsfall einmal der gesamte Fuhrpark erwacht...

@andig
Copy link
Member Author

andig commented Apr 5, 2023

Das tut der ja eh falls es dauern gepollt wird (always) oder häufiger falls er verbunden ist (connected). Wenn beides nicht der Fall ist passiert auch nix.

Ist übrigens bei Fahrzeugerkennung identisch- da wird auch einmal der Cache geputzt um alle Fahrzeuge durchzuschauen falls innerhalb vehicleDetectInterval (1m) nix gefunden wurde. Anders gehts nicht...

@nename0
Copy link
Contributor

nename0 commented Apr 5, 2023

Vielleicht müsste man dann jetzt das didChargeOnLastSocUpdate wieder raus nehmen, ansonsten könnte er zweimal updaten (einmal direkt nach dem Cache-Reset und dann nach dem Poll Interval nochmal).

@MarkusGH
Copy link
Contributor

MarkusGH commented Apr 5, 2023

Vielleicht müsste man dann jetzt das didChargeOnLastSocUpdate wieder raus nehmen, ansonsten
könnte er zweimal updaten (einmal direkt nach dem Cache-Reset und dann nach dem Poll Interval nochmal).

Denke nicht - denn im Poll Mode "charging" würde sonst gar nicht mehr aktualisiert. Der Cache Reset löst meines Erachtens selbst keinen Poll aus sondern ermöglicht ihn nur.

@nename0
Copy link
Contributor

nename0 commented Apr 5, 2023

Denke nicht - denn im Poll Mode "charging" würde sonst gar nicht mehr aktualisiert. Der Cache Reset löst meines Erachtens selbst keinen Poll aus sondern ermöglicht ihn nur.

Doch:

// update if connected and soc unknown
if lp.connected() && lp.socUpdated.IsZero() {
return true
}

@MarkusGH
Copy link
Contributor

MarkusGH commented Apr 5, 2023

Stimmt!

@andig
Copy link
Member Author

andig commented Apr 6, 2023

Ihr habt mich verloren. Bedeutet? Rein damit oder Veto?

@MarkusGH
Copy link
Contributor

MarkusGH commented Apr 6, 2023

Meine Meinung : Rein damit - erwartetes Worst Case Szenario sind zwei Polls nach Abschluss des Ladevorgangs. Muss man beobachten und ggf. didChargeOnLastSocUpdate rausnehmen. Ist nicht mein PR, deswegen kann ich es nicht präventiv machen.

@andig andig merged commit fda399b into master Apr 6, 2023
@andig andig deleted the feature/reset-cache branch April 6, 2023 13:37
@MarkusGH
Copy link
Contributor

MarkusGH commented Apr 7, 2023

Ausprobiert. Jetzt bekommt man im Poll Mode "charging" erwartungsgemäß ein Update wenn das Laden endet und ein weiteres wenn der Poll Timer abläuft. Fix: #7275

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

Successfully merging this pull request may close these issues.

4 participants