Skip to content

Commit

Permalink
Merge pull request #171 from EVerest/feature/raise_error
Browse files Browse the repository at this point in the history
Be able to raise and clear error in test controller
  • Loading branch information
maaikez authored Nov 29, 2024
2 parents 55278f2 + a8c74cc commit de49492
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.4"
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, error_string="MREC6UnderVoltage", connector_id=1):
raise_error_payload = {
"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, error_string="MREC6UnderVoltage", connector_id=1):
clear_error_payload = {
"error_type": error_string,
"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, error_string, connector_id):
"""
Produces an error (default MREC6UnderVoltage).
"""
raise NotImplementedError()

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

0 comments on commit de49492

Please sign in to comment.