pyg90alarm.notifications.protocol

Defines notification protocol for NotificationBase class.

Classes

G90NotificationProtocol()

Protocol for notification handling.

class pyg90alarm.notifications.protocol.G90NotificationProtocol

Bases: object

Protocol for notification handling.

async on_armdisarm(state)

Invoked when device is armed or disarmed.

Parameters:

state (G90ArmDisarmTypes) – State of the device

Return type:

None

async on_sensor_activity(idx, name)

Invoked on sensor activity.

Parameters:
  • idx (int) – Index of the sensor.

  • name (str) – Name of the sensor.

Return type:

None

async on_door_open_when_arming(event_id, zone_name)

Invoked when door open is detected when panel is armed.

Parameters:
  • event_id (int) – Index of the sensor.

  • zone_name (str) – Name of the sensor that reports door open.

Return type:

None

async on_door_open_close(event_id, zone_name, is_open)

Invoked when door sensor reports it opened or closed.

Parameters:
  • event_id (int) – Index of the sensor reporting the event.

  • zone_name (str) – Name of the sensor that reports door open/close.

  • is_open (bool) – Indicates if the door is open.

Return type:

None

async on_low_battery(event_id, zone_name)

Invoked when a sensor reports it is low on battery.

Parameters:
  • event_id (int) – Index of the sensor.

  • zone_name (str) – Name of the sensor that reports low battery.

Return type:

None

async on_alarm(event_id, zone_name, is_tampered)

Invoked when device triggers the alarm.

Parameters:
  • event_id (int) – Index of the sensor.

  • zone_name (str) – Name of the zone that triggered the alarm.

Return type:

None

async on_remote_button_press(event_id, zone_name, button)

Invoked when a remote button is pressed.

Please note there will only be call to the method w/o invoking G90DeviceNotifications.on_sensor_activity().

Parameters:
  • event_id (int) – Index of the sensor associated with the remote.

  • zone_name (str) – Name of the sensor that reports remote button press.

  • button (G90RemoteButtonStates) – The button pressed on the remote

Return type:

None

async on_sos(event_id, zone_name, is_host_sos)

Invoked when SOS is triggered.

Please note that the panel might not set its status to alarm internally, so that G90DeviceNotifications() might need an explicit call in the derived class to simulate that.

Parameters:
  • event_id (int) – Index of the sensor.

  • zone_name (str) – Name of the sensor that reports SOS.

  • is_host_sos (bool) – Indicates if the SOS is host-initiated.

Return type:

None

async on_sensor_change(sensor_idx, sensor_name, added)

Invoked when a sensor is added or changed on the panel.

Parameters:
  • sensor_idx (int) – Index of the sensor.

  • sensor_name (str) – Name of the sensor.

  • added (bool) – True if the sensor was added.

Return type:

None

async on_rfid_keypad(event_id, zone_name, state)

Invoked when an RFID keypad event occurs.

Parameters:
  • event_id (int) – Index of the RFID keypad.

  • zone_name (str) – Name of the RFID keypad.

  • state (G90RFIDKeypadStates) – State of the RFID keypad.

Return type:

None