Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/helpermodules/update_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -2606,8 +2606,10 @@ def upgrade_datastore_99(self) -> None:
def upgrade_datastore_100(self) -> None:
def upgrade(topic: str, payload) -> Optional[dict]:
if "openWB/general/chargemode_config/retry_failed_phase_switches" == topic:
return {"openWB/general/chargemode_config/pv_charging/retry_failed_phase_switches": payload}
return {"openWB/general/chargemode_config/pv_charging/retry_failed_phase_switches":
decode_payload(payload)}
if "openWB/general/chargemode_config/phase_switch_delay" == topic:
return {"openWB/general/chargemode_config/pv_charging/phase_switch_delay": payload}
return {"openWB/general/chargemode_config/pv_charging/phase_switch_delay":
decode_payload(payload)}
Comment on lines 2607 to +2613
Copy link
Contributor

Choose a reason for hiding this comment

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

Ist sicher gestellt, dass nur diese 2 Topics übergeben werden?

Suggested change
def upgrade(topic: str, payload) -> Optional[dict]:
if "openWB/general/chargemode_config/retry_failed_phase_switches" == topic:
return {"openWB/general/chargemode_config/pv_charging/retry_failed_phase_switches": payload}
return {"openWB/general/chargemode_config/pv_charging/retry_failed_phase_switches":
decode_payload(payload)}
if "openWB/general/chargemode_config/phase_switch_delay" == topic:
return {"openWB/general/chargemode_config/pv_charging/phase_switch_delay": payload}
return {"openWB/general/chargemode_config/pv_charging/phase_switch_delay":
decode_payload(payload)}
def upgrade(topic: str, payload) -> Optional[dict]:
return {f"openWB/general/chargemode_config/pv_charging/{topic.rsplit("/", maxsplit=1)[-1]}":
decode_payload(payload)}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Es sollen ausschließlich diese 2 Topics verschoben werden.

self._loop_all_received_topics(upgrade)
self.__update_topic("openWB/system/datastore_version", 101)