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
24 changes: 13 additions & 11 deletions packages/helpermodules/update_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

class UpdateConfig:

DATASTORE_VERSION = 87
DATASTORE_VERSION = 88

valid_topic = [
"^openWB/bat/config/bat_control_permitted$",
Expand Down Expand Up @@ -2133,16 +2133,7 @@ def upgrade(topic: str, payload) -> Optional[dict]:
self._loop_all_received_topics(upgrade)
self.__update_topic("openWB/system/datastore_version", 80)

def upgrade_datastore_80(self) -> None:
def upgrade(topic: str, payload) -> None:
if (re.search("openWB/vehicle/template/charge_template/[0-9]+", topic) is not None or
re.search("openWB/vehicle/template/ev_template/[0-9]+", topic) is not None):
payload = decode_payload(payload)
index = get_index(topic)
payload.update({"id": index})
Pub().pub(topic, payload)
self._loop_all_received_topics(upgrade)
self.__update_topic("openWB/system/datastore_version", 81)
# moved and corrected to 87

def upgrade_datastore_81(self) -> None:
def upgrade(topic: str, payload) -> None:
Expand Down Expand Up @@ -2338,3 +2329,14 @@ def upgrade_datastore_86(self) -> None:
"für die Speichersteuerung. Die Speichersteuerung war bisher bereits verfügbar, ist"
" jedoch bis zum Akzeptieren standardmäßig deaktiviert.", MessageType.WARNING)
self.__update_topic("openWB/system/datastore_version", 87)

def upgrade_datastore_87(self) -> None:
def upgrade(topic: str, payload) -> None:
if (re.search("openWB/vehicle/template/charge_template/[0-9]+", topic) is not None or
re.search("openWB/vehicle/template/ev_template/[0-9]+", topic) is not None):
payload = decode_payload(payload)
index = int(get_index(topic))
payload.update({"id": index})
Pub().pub(topic, payload)
self._loop_all_received_topics(upgrade)
self.__update_topic("openWB/system/datastore_version", 88)