33 lines
632 B
Plaintext
33 lines
632 B
Plaintext
def get_alarm_state(state):
|
|
"""
|
|
This function returns a string representing the current alarm state from
|
|
a state argument enum 1 to 7.
|
|
Args:
|
|
state: Enum for current alarm state.
|
|
Returns:
|
|
String representing current alarm state.
|
|
|
|
Raises:
|
|
KeyError: None.
|
|
"""
|
|
if state == 0:
|
|
return "Not Active"
|
|
elif state == 1:
|
|
return "Active"
|
|
elif state == 2:
|
|
return "Shelved"
|
|
# elif state == 4:
|
|
# return "Return to unacknowledged"
|
|
# elif state == 5:
|
|
# return "Shelved state"
|
|
# elif state == 6:
|
|
# return "Suppressed-by-design"
|
|
# elif state == 7:
|
|
# return "Out-of-service state"
|
|
else:
|
|
return "Unknown"
|
|
|
|
|
|
|
|
|