AlertManager

class sitchlib.AlertManager(device_id)[source]

AlertManager is used to ensure alerts are consistently formatted.

build_alert(alert_id, alert_message, location=None)[source]

Build the actual alert and returns it, formatted.

DEPRECATION NOTICE: The ‘alert_id’ field has been introduced for better readability. It’s currently set to be the same as ‘id’. At some point in the future, the ‘id’ field will be removed.

Parameters:
  • alert_id (int) – The ID of the alert you want to build
  • alert_message (str) – The message to be embedded in the alert.
Returns:

Position 0 contains the string ‘sitch_alert’. Position 1

contains the alert and metadata.

Return type:

tuple

get_alert_type(alert_id)[source]

Return the alert description for alert_id.