pyg90alarm.entities.device

Provides interface to devices (switches) of G90 alarm panel.

Classes

G90Device(*args, parent, subindex, ...)

Interacts with device (relay) on G90 alarm panel.

class pyg90alarm.entities.device.G90Device(*args, parent, subindex, proto_idx, **kwargs)

Bases: G90Sensor

Interacts with device (relay) on G90 alarm panel.

property definition: G90PeripheralDefinition | None

Returns the definition for the device.

Returns:

Device definition

async turn_on()

Turns on the device (relay)

Return type:

None

async turn_off()

Turns off the device (relay)

Return type:

None

async delete()

Deletes the device (relay) from the G90 alarm panel.

Return type:

None

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_callback for 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:

bool

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.

property is_unavailable: bool

Indicates if the sensor is unavailable (e.g. has been removed).

property is_wireless: bool

Indicates if the sensor is wireless.

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_callback for compatiblity notes

property name: str

Sensor name, accounting for multi-channel entities (single protocol entity results in multiple G90Sensor instances).

Returns:

Sensor name

property node_count: int

Number of nodes (channels) for the sensor.

Returns:

Number of nodes

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_alert_mode(value)

Sets the sensor alert mode.

Return type:

None

async set_enabled(value)

Sets the sensor enabled/disabled, using :meth:set_user_flag instead is preferred.

Parameters:

value (bool) – New the sensor should be enabled

Return type:

None

async set_flag(flag, value)

Sets the user flag for the sensor.

Parameters:
Return type:

None

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 name is read.

Parameters:

value (str) – Name to set.

Return type:

None

async set_user_flag(value)

Sets user flags of the sensor, retained for compatibility - please use :meth:set_user_flags instead.

Return type:

None

async set_user_flags(value)

Sets user flags of the sensor.

Parameters:

value (G90SensorUserFlags) – User flags to set, values other than G90SensorUserFlags.USER_SETTABLE will be ignored and preserved from existing sensor flags.

Return type:

None

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_callback for compatiblity notes

property subindex: int

Index of the sensor within multi-node device.

Returns:

Index of sensor in multi-node device.

property subtype: int

Sub-type of the sensor.

Returns:

Sensor sub-type

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_callback for compatiblity notes

property type: G90PeripheralTypes

Type of the sensor.

Returns:

Sensor type

property type_name: str | None

Type of the sensor.

Returns:

Type

update(obj)

Updates sensor from another instance.

Parameters:

obj (G90Sensor) – Sensor instance to update from

Return type:

None

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