pyg90alarm.entities.sensor_list
Sensor list.
Classes
|
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.
- async register(definition_name, room_id, timeout, name=None)
Registers sensor to the panel.
- Parameters:
- Raises:
G90EntityRegistrationError – If the registration fails.
- Return type:
- 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.
- async find_by_idx(idx, exclude_unavailable, subindex=0)
Finds entity by index.
- 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:
- 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