Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
LKuemmel committed Jan 3, 2025
1 parent 6873e9e commit 1e18421
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/helpermodules/setdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ def process_chargepoint_get_topics(self, msg):
elif "/get/fault_state" in msg.topic:
self._validate_value(msg, int, [(0, 2)])
elif ("/get/evse_current" in msg.topic or
"/get/max_evse_current"):
"/get/max_evse_current" in msg.topic):
self._validate_value(msg, float, [(0, 0), (6, 32), (600, 3200)])
elif ("/get/error_timestamp" in msg.topic or
"/get/rfid_timestamp" in msg.topic):
Expand Down
1 change: 1 addition & 0 deletions packages/helpermodules/update_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class UpdateConfig:
"^openWB/chargepoint/[0-9]+/get/fault_state$",
"^openWB/chargepoint/[0-9]+/get/fault_str$",
"^openWB/chargepoint/[0-9]+/get/frequency$",
"^openWB/chargepoint/[0-9]+/get/max_evse_current$",
"^openWB/chargepoint/[0-9]+/get/plug_state$",
"^openWB/chargepoint/[0-9]+/get/phases_in_use$",
"^openWB/chargepoint/[0-9]+/get/exported$",
Expand Down
22 changes: 14 additions & 8 deletions packages/modules/internal_chargepoint_handler/socket.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
from modules.internal_chargepoint_handler.clients import ClientHandler
from modules.internal_chargepoint_handler.chargepoint_module import ChargepointModule
from modules.common.component_state import ChargepointState
from modules.common.component_context import SingleComponentUpdateContext
from helpermodules.logger import ModifyLoglevelContext
from typing import Callable, Tuple
from helpermodules.hardware_configuration import get_hardware_configuration_setting
from typing import Callable
from enum import IntEnum
import functools
import logging
import time
from typing import Callable
from helpermodules.hardware_configuration import get_hardware_configuration_setting
<< << << < HEAD

Check failure on line 13 in packages/modules/internal_chargepoint_handler/socket.py

View workflow job for this annotation

GitHub Actions / build

SyntaxError: invalid syntax
== == == =
>>>>>> > 3bad4f628(fixes)

from modules.common.component_context import SingleComponentUpdateContext
from modules.common.component_state import ChargepointState
from modules.internal_chargepoint_handler.chargepoint_module import ChargepointModule
from modules.internal_chargepoint_handler.clients import ClientHandler

log = logging.getLogger(__name__)

Expand Down Expand Up @@ -52,8 +57,8 @@ def __init__(self,
parent_cp: int,
hierarchy_id: int) -> None:
self.socket_max_current = get_hardware_configuration_setting("max_c_socket")
self.chargepoint_state.max_evse_current = self.socket_max_current
log.debug(f"Konfiguration als Buchse mit maximal {self.socket_max_current}A Ladestrom je Phase.")
with ModifyLoglevelContext(log, logging.DEBUG):
log.info(f"Konfiguration als Buchse mit maximal {self.socket_max_current}A Ladestrom je Phase.")
super().__init__(local_charge_point_num, client_handler, parent_hostname, parent_cp, hierarchy_id)

def set_current(self, current: float) -> None:
Expand All @@ -75,6 +80,7 @@ def get_values(self, phase_switch_cp_active: bool, last_tag: str) -> Chargepoint
actor = ActorState(GPIO.input(19))
log.debug("Actor: "+str(actor))
self.chargepoint_state = super().get_values(phase_switch_cp_active, last_tag)
self.chargepoint_state.max_evse_current = self.socket_max_current
if phase_switch_cp_active:
log.debug("Keine Actor-Bewegung, da CP-Unterbrechung oder Phasenumschaltung aktiv.")
else:
Expand Down

0 comments on commit 1e18421

Please sign in to comment.