diff --git a/everest-testing/src/everest/testing/__init__.py b/everest-testing/src/everest/testing/__init__.py index dd694a0..38c7fc3 100644 --- a/everest-testing/src/everest/testing/__init__.py +++ b/everest-testing/src/everest/testing/__init__.py @@ -1 +1 @@ -__version__="0.4.3" +__version__="0.4.4" \ No newline at end of file diff --git a/everest-testing/src/everest/testing/core_utils/controller/everest_test_controller.py b/everest-testing/src/everest/testing/core_utils/controller/everest_test_controller.py index 8471085..774aa2c 100644 --- a/everest-testing/src/everest/testing/core_utils/controller/everest_test_controller.py +++ b/everest-testing/src/everest/testing/core_utils/controller/everest_test_controller.py @@ -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) diff --git a/everest-testing/src/everest/testing/core_utils/controller/test_controller_interface.py b/everest-testing/src/everest/testing/core_utils/controller/test_controller_interface.py index 90e3a23..5ea8caa 100644 --- a/everest-testing/src/everest/testing/core_utils/controller/test_controller_interface.py +++ b/everest-testing/src/everest/testing/core_utils/controller/test_controller_interface.py @@ -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()