pyg90alarm.entities.sensor_list

Sensor list.

Classes

G90SensorList(parent)

Sensor list class.

class pyg90alarm.entities.sensor_list.G90SensorList(parent)

Bases: G90BaseList[G90Sensor]

Sensor list class.

async sensor_change_callback(idx, name, added)

Sensor change callback.

Should be invoked from corresponding panel’s notification handler to finish the registration process.

Parameters:
  • idx (int) – Sensor index.

  • name (str) – Sensor name.

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

Return type:

None

async register(definition_name, room_id, timeout, name=None)

Registers sensor to the panel.

Parameters:
  • definition_name (str) – Sensor definition name.

  • room_id (int) – Room ID to assign the sensor to.

  • timeout (float) – Timeout for the registration process.

  • name (str | None) – Optional name for the sensor, if not provided, the definition name will be used.

Raises:

G90EntityRegistrationError – If the registration fails.

Return type:

G90Sensor

Returns:

G90Sensor: The registered sensor entity.

property entities: List[T]

Return the list of entities.

update() is called if the list is empty.

Returns:

List of entities

async find(idx, name, exclude_unavailable, subindex=0)

Finds entity by index, subindex and name.

Parameters:
  • idx (int) – Entity index

  • name (str) – Entity name

  • exclude_unavailable (bool) – Exclude unavailable entities

  • subindex (int) – Entity subindex

Return type:

TypeVar(T, bound= G90BaseEntity) | None

Returns:

Entity instance or None if not found

async find_by_idx(idx, exclude_unavailable, subindex=0)

Finds entity by index.

Parameters:
  • idx (int) – Entity index

  • exclude_unavailable (bool) – Exclude unavailable entities

  • subindex (int) – Entity subindex

Return type:

TypeVar(T, bound= G90BaseEntity) | None

Returns:

Entity instance or None if not found

async find_free_idx()

Finds the first free index in the list.

The index is from protocol point of view (.index attribute of the protocol data), not the index in the list. The index is required when registering a new entity on the panel.

Return type:

int

Returns:

Free index

property list_change_callback: Callable[[T, bool], None] | Callable[[T, bool], Coroutine[None, None, None]] | None

List change callback.

Invoked when the list of entities is changed, i.e. when a new entity is added or an existing one is updated.

Returns:

Callback

async update()

Update the list of entities from the panel.

Return type:

List[TypeVar(T, bound= G90BaseEntity)]

Returns:

List of entities