File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
modules/chargepoints/openwb_pro Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 11from requests import HTTPError
2- from requests .exceptions import ConnectionError
2+ from requests .exceptions import ConnectionError , ReadTimeout
33
44from helpermodules .exceptions .registry import ExceptionRegistry
55
@@ -8,6 +8,10 @@ def handle_connection_error(e: ConnectionError):
88 return "Die Verbindung zum Server {} ist fehlgeschlagen. Überprüfe Adresse und Netzwerk." .format (e .request .url )
99
1010
11+ def handle_read_timeout (e : ReadTimeout ):
12+ return "Innerhalb des Timeouts wurde keine Anwort erhalten. Überprüfe Adresse und Netzwerk."
13+
14+
1115def handle_http_error (e : HTTPError ):
1216 code = e .response .status_code
1317 if 400 <= code < 500 :
@@ -22,3 +26,4 @@ def handle_http_error(e: HTTPError):
2226def register_request_exception_handlers (registry : ExceptionRegistry ) -> None :
2327 registry .add (ConnectionError , handle_connection_error )
2428 registry .add (HTTPError , handle_http_error )
29+ registry .add (ReadTimeout , handle_read_timeout )
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ def __init__(self, config: OpenWBPro) -> None:
3939
4040 def set_internal_context_handlers (self , parent_cp , parent_hostname ):
4141 self .fault_state = FaultState (ComponentInfo (
42- parent_cp ,
42+ self . config . id ,
4343 "Ladepunkt " + str (self .config .id ),
4444 "chargepoint" ,
4545 parent_id = parent_cp ,
You can’t perform that action at this time.
0 commit comments