pyg90alarm.local.alert_config

Represents various configuration aspects of the alarm panel.

Classes

G90AlertConfig(parent)

Represents alert configuration as received from the alarm panel.

G90AlertConfigData(flags_data)

Represents alert configuration data as received from the alarm panel.

flag pyg90alarm.local.alert_config.G90AlertConfigFlags(value)

Bases: IntFlag

Alert configuration flags, used bitwise

Member Type:

int

Valid values are as follows:

AC_POWER_FAILURE = <G90AlertConfigFlags.AC_POWER_FAILURE: 1>
AC_POWER_RECOVER = <G90AlertConfigFlags.AC_POWER_RECOVER: 2>
ARM_DISARM = <G90AlertConfigFlags.ARM_DISARM: 4>
HOST_LOW_VOLTAGE = <G90AlertConfigFlags.HOST_LOW_VOLTAGE: 8>
SENSOR_LOW_VOLTAGE = <G90AlertConfigFlags.SENSOR_LOW_VOLTAGE: 16>
WIFI_AVAILABLE = <G90AlertConfigFlags.WIFI_AVAILABLE: 32>
WIFI_UNAVAILABLE = <G90AlertConfigFlags.WIFI_UNAVAILABLE: 64>
DOOR_OPEN = <G90AlertConfigFlags.DOOR_OPEN: 128>
DOOR_CLOSE = <G90AlertConfigFlags.DOOR_CLOSE: 256>
SMS_PUSH = <G90AlertConfigFlags.SMS_PUSH: 512>
UNKNOWN1 = <G90AlertConfigFlags.UNKNOWN1: 2048>
UNKNOWN2 = <G90AlertConfigFlags.UNKNOWN2: 8192>

The Flag and its members also have the following methods:

conjugate()

Returns self, the complex conjugate of any int.

bit_length()

Number of bits necessary to represent self in binary.

>>> bin(37)
'0b100101'
>>> (37).bit_length()
6
bit_count()

Number of ones in the binary representation of the absolute value of self.

Also known as the population count.

>>> bin(13)
'0b1101'
>>> (13).bit_count()
3
to_bytes(length=1, byteorder='big', *, signed=False)

Return an array of bytes representing an integer.

length

Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

byteorder

The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.

signed

Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

classmethod from_bytes(bytes, byteorder='big', *, signed=False)

Return the integer represented by the given array of bytes.

bytes

Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

byteorder

The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use sys.byteorder as the byte order value. Default is to use ‘big’.

signed

Indicates whether two’s complement is used to represent the integer.

as_integer_ratio()

Return a pair of integers, whose ratio is equal to the original int.

The ratio is in lowest terms and has a positive denominator.

>>> (10).as_integer_ratio()
(10, 1)
>>> (-10).as_integer_ratio()
(-10, 1)
>>> (0).as_integer_ratio()
(0, 1)
is_integer()

Returns True. Exists for duck type compatibility with float.is_integer.

real

the real part of a complex number

imag

the imaginary part of a complex number

numerator

the numerator of a rational number in lowest terms

denominator

the denominator of a rational number in lowest terms

class pyg90alarm.local.alert_config.G90AlertConfigData(flags_data)

Bases: object

Represents alert configuration data as received from the alarm panel.

property flags: G90AlertConfigFlags
Returns:

The alert configuration flags

class pyg90alarm.local.alert_config.G90AlertConfig(parent)

Bases: object

Represents alert configuration as received from the alarm panel.

async set(flags)
Return type:

None

Deprecated since version 2.3.0.

This method is deprecated and will always raise a RuntimeError. Please use set_flag() to set individual flags.

async get_flag(flag)
Parameters:

flag (G90AlertConfigFlags) – The flag to check

Return type:

bool

async set_flag(flag, value)

Sets the given flag to the desired value.

Uses read-modify-write approach.

Parameters:
Return type:

None

property flags: G90AlertConfigFlags
Returns:

Symbolic names for corresponding flag bits

property flags_with_fallback: G90AlertConfigFlags | None
Returns:

Symbolic names for corresponding flag bits, falling back to cached data if device communication fails