Skip to content

Commit 1c56b03

Browse files
authored
move datastore 97 for patch version (#2908)
1 parent 14cfe09 commit 1c56b03

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

packages/helpermodules/update_config.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
class UpdateConfig:
5959

60-
DATASTORE_VERSION = 101
60+
DATASTORE_VERSION = 102
6161

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

2567-
def upgrade_datastore_97(self) -> None:
2568-
def upgrade(topic: str, payload) -> None:
2569-
if re.search("openWB/system/device/[0-9]+/config$", topic) is not None:
2570-
payload = decode_payload(payload)
2571-
# add phase
2572-
if payload.get("type") == "shelly" and "phase" not in payload["configuration"]:
2573-
payload["configuration"].update({"phase": 1})
2574-
Pub().pub(topic, payload)
2575-
self._loop_all_received_topics(upgrade)
2576-
self.__update_topic("openWB/system/datastore_version", 98)
2577-
25782567
def upgrade_datastore_98(self) -> None:
25792568
version_str = decode_payload(
25802569
self.all_received_topics.get("openWB/system/version", "2.1.9"))
@@ -2613,3 +2602,14 @@ def upgrade(topic: str, payload) -> Optional[dict]:
26132602
decode_payload(payload)}
26142603
self._loop_all_received_topics(upgrade)
26152604
self.__update_topic("openWB/system/datastore_version", 101)
2605+
2606+
def upgrade_datastore_101(self) -> None:
2607+
def upgrade(topic: str, payload) -> None:
2608+
if re.search("openWB/system/device/[0-9]+/config$", topic) is not None:
2609+
payload = decode_payload(payload)
2610+
# add phase
2611+
if payload.get("type") == "shelly" and "phase" not in payload["configuration"]:
2612+
payload["configuration"].update({"phase": 1})
2613+
Pub().pub(topic, payload)
2614+
self._loop_all_received_topics(upgrade)
2615+
self.__update_topic("openWB/system/datastore_version", 102)

0 commit comments

Comments
 (0)