Skip to content

chore: simplify external battery mode #20556

Closed
iseeberg79 wants to merge 11 commits into
evcc-io:masterfrom
iseeberg79:chore/batteryModeApi
Closed

chore: simplify external battery mode #20556
iseeberg79 wants to merge 11 commits into
evcc-io:masterfrom
iseeberg79:chore/batteryModeApi

Conversation

@iseeberg79
Copy link
Copy Markdown
Contributor

alternative as follow-up to #20455

@iseeberg79
Copy link
Copy Markdown
Contributor Author

@andig schau mal...

@andig
Copy link
Copy Markdown
Member

andig commented Apr 12, 2025

Test failed

Comment thread core/site_api.go
@@ -365,34 +365,46 @@ func (site *Site) SetBatteryModeExternal(mode api.BatteryMode) {
site.publish(keys.BatteryModeExternal, mode)

if !disable {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why/what for? For time being, external mode is still active. So no point doing this here and later in site.go

Copy link
Copy Markdown
Contributor Author

@iseeberg79 iseeberg79 Apr 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hier verstehe ich nicht, was gemeint ist - alles richtig

@iseeberg79
Copy link
Copy Markdown
Contributor Author

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.

@andig andig closed this Apr 13, 2025
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

Successfully merging this pull request may close these issues.

2 participants