Skip to content

Commit

Permalink
Error type (string) can now be specified.
Browse files Browse the repository at this point in the history
Signed-off-by: Maaike Zijderveld, iolar <[email protected]>
  • Loading branch information
maaikez committed Nov 28, 2024
1 parent 91702f4 commit 624f819
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,19 +86,19 @@ def diode_fail(self, connector_id=1):
f"{self._mqtt_external_prefix}everest_external/nodered/{connector_id}/carsim/cmd/execute_charging_session",
"sleep 1;iec_wait_pwr_ready;sleep 1;draw_power_regulated 32,3;sleep 5;diode_fail;sleep 36000;unplug")

def raise_error(self, connector_id=1):
def raise_error(self, error_string="MREC6UnderVoltage", connector_id=1):
raise_error_payload = {
"error_type": "MREC6UnderVoltage",
"error_type": error_string,
"raise": "true"
}

self._mqtt_client.publish(
f"{self._mqtt_external_prefix}everest_external/nodered/{connector_id}/carsim/error",
json.dumps(raise_error_payload))

def clear_error(self, connector_id=1):
def clear_error(self, error_string="MREC6UnderVoltage", connector_id=1):
clear_error_payload = {
"error_type": "MREC6UnderVoltage",
"error_type": error_string,
"raise": "false"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ def didoe_fail(self):
"""
raise NotImplementedError()

def raise_error(self, connector_id):
def raise_error(self, error_string, connector_id):
"""
Produces an error (MREC6UnderVoltage).
Produces an error (default MREC6UnderVoltage).
"""
raise NotImplementedError()

def clear_error(self, connector_id):
def clear_error(self, error_string, connector_id):
"""
Clears an error (MREC6UnderVoltage).
Clears an error (default MREC6UnderVoltage).
"""
raise NotImplementedError()

0 comments on commit 624f819

Please sign in to comment.