|
57 | 57 |
|
58 | 58 | class UpdateConfig: |
59 | 59 |
|
60 | | - DATASTORE_VERSION = 101 |
| 60 | + DATASTORE_VERSION = 102 |
61 | 61 |
|
62 | 62 | valid_topic = [ |
63 | 63 | "^openWB/bat/config/bat_control_permitted$", |
@@ -2564,17 +2564,6 @@ def upgrade(topic: str, payload) -> Optional[dict]: |
2564 | 2564 | self._loop_all_received_topics(upgrade) |
2565 | 2565 | self.__update_topic("openWB/system/datastore_version", 96) |
2566 | 2566 |
|
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 | | - |
2578 | 2567 | def upgrade_datastore_98(self) -> None: |
2579 | 2568 | version_str = decode_payload( |
2580 | 2569 | self.all_received_topics.get("openWB/system/version", "2.1.9")) |
@@ -2613,3 +2602,14 @@ def upgrade(topic: str, payload) -> Optional[dict]: |
2613 | 2602 | decode_payload(payload)} |
2614 | 2603 | self._loop_all_received_topics(upgrade) |
2615 | 2604 | 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