pyg90alarm.entities.device
Provides interface to devices (switches) of G90 alarm panel.
Classes
|
Interacts with device (relay) on G90 alarm panel. |
- class pyg90alarm.entities.device.G90Device(*args, parent, subindex, proto_idx, **kwargs)
Bases:
G90SensorInteracts with device (relay) on G90 alarm panel.
- property definition: G90PeripheralDefinition | None
Returns the definition for the device.
- Returns:
Device definition
- property alert_mode: G90SensorAlertModes
Alert mode for the sensor.
- Returns:
Alert mode
- property door_open_when_arming_callback: G90CallbackList[Callable[[], None] | Callable[[], Coroutine[None, None, None]]]
Callback that is invoked when the sensor reports on open door condition when arming.
- Returns:
Sensor’s door open when arming callback
See also
G90Alarm.sensor_callbackfor compatiblity notes
- property enabled: bool
Indicates if the sensor is enabled, using :meth:get_user_flag instead is preferred.
- Returns:
If sensor is enabled
- property extra_data: Any
Extra data for the sensor, that can be used to store caller-specific information and will be carried by the sensor instance.
- get_flag(flag)
Gets the user flag for the sensor.
- Parameters:
flag (
G90SensorUserFlags) – User flag to get- Return type:
- Returns:
User flag value
- property index: int
Index (internal position) of the sensor in the alarm panel.
- Returns:
Internal sensor position
- property is_door_open_when_arming: bool
Indicates if the sensor reports on open door when arming.
The condition is cleared when panel is armed/disarmed next time.
- property is_low_battery: bool
Indicates if the sensor is reporting low battery.
The condition is cleared when the sensor reports activity (i.e. is no longer low on battery as it is able to report the activity).
- property is_tampered: bool
Indicates if the sensor has been tampered.
The condition is cleared when panel is armed/disarmed next time.
Indicates if the sensor is unavailable (e.g. has been removed).
- property low_battery_callback: G90CallbackList[Callable[[], None] | Callable[[], Coroutine[None, None, None]]]
Callback that is invoked when the sensor reports on low battery condition.
- Returns:
Sensor’s low battery callback
See also
G90Alarm.sensor_callbackfor compatiblity notes
- property name: str
Sensor name, accounting for multi-channel entities (single protocol entity results in multiple
G90Sensorinstances).- Returns:
Sensor name
- property occupancy: bool
Occupancy (occupied/not occupied, or triggered/not triggered) for the sensor.
- Returns:
Sensor occupancy
- property parent: G90Alarm
Parent instance of alarm panel class the sensor is associated with.
- Returns:
Parent instance
- property proto_idx: int
Index of the sensor within list of sensors as retrieved from the alarm panel.
- Returns:
Index of sensor in list of sensors.
- property protocol: G90PeripheralProtocols
Protocol type of the sensor.
- Returns:
Protocol type
- property protocol_data: G90SensorIncomingData
Protocol data of the sensor.
- Returns:
Protocol data
- property reserved: G90SensorReservedFlags
Reserved flags (read/write mode) for the sensor.
- Returns:
Reserved flags
- async set_enabled(value)
Sets the sensor enabled/disabled, using :meth:set_user_flag instead is preferred.
- async set_flag(flag, value)
Sets the user flag for the sensor.
- Parameters:
flag (
G90SensorUserFlags) – User flag to setvalue (
bool) – New value for the user flag
- Return type:
- async set_name(value)
Sets sensor name on the panel.
For multi-node entities the name is shared by all nodes on the panel; node suffixes are derived locally when the
nameis read.
- async set_user_flag(value)
Sets user flags of the sensor, retained for compatibility - please use :meth:set_user_flags instead.
- Return type:
- async set_user_flags(value)
Sets user flags of the sensor.
- Parameters:
value (
G90SensorUserFlags) – User flags to set, values other thanG90SensorUserFlags.USER_SETTABLEwill be ignored and preserved from existing sensor flags.- Return type:
- property state_callback: G90CallbackList[Callable[[bool], None] | Callable[[bool], Coroutine[None, None, None]]]
Callback that is invoked when the sensor changes its state.
- Returns:
Sensor state callback
See also
G90Alarm.sensor_callbackfor compatiblity notes
- property subindex: int
Index of the sensor within multi-node device.
- Returns:
Index of sensor in multi-node device.
- property supports_enable_disable: bool
Indicates if disabling/enabling the sensor is supported.
- Returns:
Support for enabling/disabling the sensor
- property supports_updates: bool
Indicates if the sensor supports updates.
- Returns:
Support for updates
- property tamper_callback: G90CallbackList[Callable[[], None] | Callable[[], Coroutine[None, None, None]]]
Callback that is invoked when the sensor reports being tampered.
- Returns:
Sensor’s tamper callback
See also
G90Alarm.sensor_callbackfor compatiblity notes
- property type: G90PeripheralTypes
Type of the sensor.
- Returns:
Sensor type
- update(obj)
Updates sensor from another instance.
- property user_flag: G90SensorUserFlags
User flags for the sensor, retained for compatibility - please use :attr:user_flags instead.
- Returns:
User flags
- property user_flags: G90SensorUserFlags
User flags for the sensor (disabled/enabled, arming type etc).
- Returns:
User flags