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

class UpdateConfig:

DATASTORE_VERSION = 101
DATASTORE_VERSION = 102

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

def upgrade_datastore_97(self) -> None:
def upgrade(topic: str, payload) -> None:
if re.search("openWB/system/device/[0-9]+/config$", topic) is not None:
payload = decode_payload(payload)
# add phase
if payload.get("type") == "shelly" and "phase" not in payload["configuration"]:
payload["configuration"].update({"phase": 1})
Pub().pub(topic, payload)
self._loop_all_received_topics(upgrade)
self.__update_topic("openWB/system/datastore_version", 98)

def upgrade_datastore_98(self) -> None:
version_str = decode_payload(
self.all_received_topics.get("openWB/system/version", "2.1.9"))
Expand Down Expand Up @@ -2613,3 +2602,14 @@ def upgrade(topic: str, payload) -> Optional[dict]:
decode_payload(payload)}
self._loop_all_received_topics(upgrade)
self.__update_topic("openWB/system/datastore_version", 101)

def upgrade_datastore_101(self) -> None:
def upgrade(topic: str, payload) -> None:
if re.search("openWB/system/device/[0-9]+/config$", topic) is not None:
payload = decode_payload(payload)
# add phase
if payload.get("type") == "shelly" and "phase" not in payload["configuration"]:
payload["configuration"].update({"phase": 1})
Pub().pub(topic, payload)
self._loop_all_received_topics(upgrade)
self.__update_topic("openWB/system/datastore_version", 102)