pyg90alarm.entities.base_list

Base entity list.

Classes

G90BaseList(parent)

Base entity list class.

class pyg90alarm.entities.base_list.G90BaseList(parent)

Bases: Generic[T], ABC

Base entity list class.

Parameters:

parent (object) – Parent alarm panel instance.

property entities: List[T]

Return the list of entities.

update() is called if the list is empty.

Returns:

List of entities

async update()

Update the list of entities from the panel.

Return type:

List[TypeVar(T, bound= G90BaseEntity)]

Returns:

List of entities

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(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_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