Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions packages/helpermodules/update_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ class UpdateConfig:
("openWB/optional/rfid/active", False),
("openWB/system/backup_cloud/config", NO_MODULE),
("openWB/system/backup_cloud/backup_before_update", True),
("openWB/system/current_branch", None),
("openWB/system/current_commit", None),
("openWB/system/installAssistantDone", False),
("openWB/system/dataprotection_acknowledged", False),
("openWB/system/datastore_version", DATASTORE_VERSION),
Expand Down
10 changes: 10 additions & 0 deletions packages/modules/internal_chargepoint_handler/pro_plus.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import requests
from helpermodules.subdata import SubData
from modules.chargepoints.openwb_pro.chargepoint_module import ChargepointModule
from modules.chargepoints.openwb_pro.config import OpenWBPro, OpenWBProConfiguration
from modules.common.component_state import ChargepointState
Expand All @@ -18,6 +19,12 @@ def __init__(self, local_charge_point_num: int,
self.store_internal = get_internal_chargepoint_value_store(local_charge_point_num)
self.store = get_chargepoint_value_store(hierarchy_id)
self.old_chargepoint_state = None
try:
self.version = SubData.system_data["system"].data["version"]
self.current_branch = SubData.system_data["system"].data["current_branch"]
self.current_commit = SubData.system_data["system"].data["current_commit"]
except KeyError:
raise KeyError("Warten auf Versionsinformationen")

super().__init__(OpenWBPro(configuration=OpenWBProConfiguration(ip_address="192.168.192.50")))
self.set_internal_context_handlers(hierarchy_id, internal_cp)
Expand All @@ -35,6 +42,9 @@ def store_state(chargepoint_state: ChargepointState) -> None:
if chargepoint_state is not None and last_tag is not None and last_tag != "":
chargepoint_state.rfid = last_tag
if chargepoint_state is not None:
chargepoint_state.version = self.version
chargepoint_state.current_branch = self.current_branch
chargepoint_state.current_commit = self.current_commit
store_state(chargepoint_state)
return chargepoint_state
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
from unittest.mock import Mock

import pytest
from modules.internal_chargepoint_handler.pro_plus import SubData
from modules.common.component_state import ChargepointState
from modules.internal_chargepoint_handler.internal_chargepoint_handler_config import InternalChargepoint
from modules.internal_chargepoint_handler.pro_plus import ProPlus


@pytest.fixture(autouse=True)
def setup_pro_plus(monkeypatch) -> Tuple[ProPlus, Mock]:
system_data_mock = Mock(data={"version": "1.0.0", "current_branch": "main", "current_commit": "abc123"})
monkeypatch.setattr(SubData, "system_data", {"system": system_data_mock})
pro_plus = ProPlus(0, InternalChargepoint(), 1)
mock_store_set = Mock()
monkeypatch.setattr(pro_plus.store, "set", mock_store_set)
Expand Down