Skip to content

Commit

Permalink
Be able to raise and clear error in test controller
Browse files Browse the repository at this point in the history
Signed-off-by: Maaike Zijderveld, iolar <git.mail@iolar.nl>
  • Loading branch information
maaikez committed Nov 26, 2024
1 parent 55278f2 commit 91702f4
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion everest-testing/src/everest/testing/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__="0.4.3"
__version__="0.4.5"
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,26 @@ 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):
raise_error_payload = {
"error_type": "MREC6UnderVoltage",
"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):
clear_error_payload = {
"error_type": "MREC6UnderVoltage",
"raise": "false"
}

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

def publish(self, topic, payload):
self._mqtt_client.publish(topic, payload)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,15 @@ def didoe_fail(self):
Produces an RCD Error.
"""
raise NotImplementedError()

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

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

0 comments on commit 91702f4

Please sign in to comment.