Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to raise and clear error in test controller #171

Merged
merged 3 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()