chore: simplify external battery mode #20556
Conversation
|
@andig schau mal... |
|
Test failed |
| @@ -365,34 +365,46 @@ func (site *Site) SetBatteryModeExternal(mode api.BatteryMode) { | |||
| site.publish(keys.BatteryModeExternal, mode) | |||
|
|
|||
| if !disable { | |||
There was a problem hiding this comment.
Why/what for? For time being, external mode is still active. So no point doing this here and later in site.go
There was a problem hiding this comment.
publishing state is essential if external state is active - and on expiration the external state should show it's invalidity (expired) by getting reset? The published external mode should only show the state evcc is aware of including the timer state - at least in my opinion. If not necessary we could drop the watchdog completely and rely on expiration. Is that your point?
There was a problem hiding this comment.
hier verstehe ich nicht, was gemeint ist - alles richtig
|
Beide Varianten sind fehlerfrei, unterscheiden sich aber darin, wo die externe Steuerung gepflegt wird. Entweder im Setter, oder über den Aufruf aus dem Thread des Kontrollintervalls per batteryModeWatchdogExpired. Ich habe den Testfall angepasst und um einige Testfälle erweitert, da die Logik leicht unterschiedlich ist und mir wichtig war, auch zu prüfen, ob nach der Batteriesteuerung wirklich batteryNormal aktiv ist. Denn wenn nicht, kam es zu dem Fehlerbild eines dauerhaften modbus-write der Batteriesteuerung durch den dort verwendeten modbus-Watchdog. |
alternative as follow-up to #20455