aiovantage.controllers
¶
Controllers for managing collections of objects from the Vantage system.
Controllers are responsible for fetching objects, fetching their state, and keeping the state up to date.
Some controllers manage a single type of object, while others handle multiple types.
In controllers where multiple object types are managed, they are typically conceptually
related through shared behavior rather than a strict class hierarchy. These types of
controllers typically hold objects which implement one or more common interfaces. For
examples, objects in the BlindsController
all implement the BlindInterface.
Controllers implement QuerySet, which
provides a number of methods for filtering and finding objects, such as
filter and
get.
Controllers also implement EventDispatcher,
which allows you to subscribe to events related to the objects managed by the controller
with subscribe. The following
events are emitted by controllers:
ObjectAdded,
ObjectUpdated,
ObjectDeleted
An instance of every controller type is made available through the main Vantage object.
Classes:
-
AnemoSensorsController–Anemo sensors (wind speed sensors) controller.
-
AreasController–Areas controller.
-
BackBoxesController–Back boxes controller.
-
Controller–Base controller for managing collections of Vantage objects.
-
StatusType–The type of status that the controller is using for state monitoring.
-
BlindGroupsController–Blind groups controller.
-
BlindsController–Blinds controller.
-
ButtonsController–Buttons controller.
-
DryContactsController–Dry contacts controller.
-
GMemController–GMem (variables) controller.
-
LightSensorsController–Light sensors controller.
-
LoadGroupsController–Load groups controller.
-
LoadsController–Loads controller.
-
MastersController–Masters (InFusion Controllers) controller.
-
ModulesController–Modules controller.
-
OmniSensorsController–Omni sensors controller.
-
PortDevicesController–Port devices controller.
-
PowerProfilesController–Power profiles controller.
-
QuerySet–Queryset class for querying objects from a dictionary.
-
RGBLoadsController–RGB loads controller.
-
StationsController–Stations controller.
-
TasksController–Tasks controller.
-
TemperaturesController–Temperature device controller.
-
ThermostatsController–Thermostats controller.
Attributes:
-
BlindGroupTypes–Types managed by the blind groups controller.
-
BlindTypes–Types managed by the blinds controller.
-
RGBLoadTypes–Types managed by the RGB loads controller.
-
ThermostatTypes–Types managed by the thermostats controller.
BlindGroupTypes
module-attribute
¶
BlindGroupTypes = BlindGroup | SomfyRS485GroupChild | SomfyURTSI2GroupChild
Types managed by the blind groups controller.
BlindTypes
module-attribute
¶
BlindTypes = QISBlind | QubeBlind | RelayBlind | SomfyRS485ShadeChild | SomfyURTSI2ShadeChild
Types managed by the blinds controller.
RGBLoadTypes
module-attribute
¶
RGBLoadTypes = VantageDDGColorLoad | VantageDGColorLoad
Types managed by the RGB loads controller.
ThermostatTypes
module-attribute
¶
ThermostatTypes = Thermostat | VantageGenericHVACRS485ZoneChild | VantageGenericHVACRS485ZoneWithoutFanSpeedChild | VantageHVACIUZoneChild | VantageVirtualThermostatPort
Types managed by the thermostats controller.
BackBoxesController
¶
BackBoxesController(vantage: Vantage)
Bases: Controller[BackBox]
Back boxes controller.
Back boxes typically represent a "gang box" in a wall which may contain multiple stations, dimmers, etc. It is mostly useful to know about these devices so we can set up a proper device hierarchy.
Controller
¶
Controller(vantage: Vantage)
Bases: QuerySet[T], EventDispatcher
Base controller for managing collections of Vantage objects.
Parameters:
-
vantage(Vantage) –The Vantage instance.
Methods:
-
initialize–Populate the controller, and optionally fetch object state.
-
fetch_state–Fetch the state properties of all objects managed by this controller.
-
enable_state_monitoring–Monitor for state changes on objects managed by this controller.
-
disable_state_monitoring–Stop monitoring for state changes on objects managed by this controller.
Attributes:
-
vantage_types(tuple[str, ...]) –The Vantage object types that this controller will fetch.
-
force_category_status(bool) –Whether to force the controller to handle 'STATUS' categories.
-
status_type(StatusType | None) –Return the type of status event that the controller is monitoring.
vantage_types
instance-attribute
¶
The Vantage object types that this controller will fetch.
force_category_status
class-attribute
instance-attribute
¶
force_category_status: bool = False
Whether to force the controller to handle 'STATUS' categories.
status_type
property
¶
status_type: StatusType | None
Return the type of status event that the controller is monitoring.
initialize
async
¶
fetch_state
async
¶
fetch_state() -> None
Fetch the state properties of all objects managed by this controller.
enable_state_monitoring
async
¶
enable_state_monitoring() -> None
Monitor for state changes on objects managed by this controller.
disable_state_monitoring
async
¶
disable_state_monitoring() -> None
Stop monitoring for state changes on objects managed by this controller.
StatusType
¶
BlindsController
¶
BlindsController(vantage: Vantage)
Bases: Controller[BlindTypes]
Blinds controller.
Methods:
-
in_blind_group–Return a queryset of all loads in the given blind group.
in_blind_group
¶
in_blind_group(blind_group: BlindGroup) -> QuerySet[BlindTypes]
Return a queryset of all loads in the given blind group.
LoadsController
¶
LoadsController(vantage: Vantage)
Bases: Controller[Load]
Loads controller.
Methods:
-
in_load_group–Return a queryset of all loads in the given load group.
Attributes:
-
on(QuerySet[Load]) –Return a queryset of all loads that are turned on.
-
off(QuerySet[Load]) –Return a queryset of all loads that are turned off.
-
relays(QuerySet[Load]) –Return a queryset of all loads that are relays.
-
motors(QuerySet[Load]) –Return a queryset of all loads that are motors.
-
lights(QuerySet[Load]) –Return a queryset of all loads that are lights.
ModulesController
¶
ModulesController(vantage: Vantage)
Bases: Controller[SystemObject]
Modules controller.
Modules are relay or dimming modules connected to the Vantage system.
OmniSensorsController
¶
OmniSensorsController(vantage: Vantage)
Bases: Controller[OmniSensor]
Omni sensors controller.
Omni sensors are generic sensors objects which specify which methods to use when getting or setting data in their object definition, as well as the type of data and a conversion formula.
PortDevicesController
¶
PortDevicesController(vantage: Vantage)
Bases: Controller[PortDevice]
Port devices controller.
Port devices are typically "hubs" that communicate with other devices such as blinds or lighting systems. It is mostly useful to know about these devices so we can set up a proper device hierarchy.
QuerySet
¶
QuerySet(data: dict[int, T], populate: Callable[[], Awaitable[None]], filters: list[Callable[[T], Any]] | None = None)
Bases: Iterable[T], AsyncIterator[T]
Queryset class for querying objects from a dictionary.
Querysets are iterable and async iterable, and can be chained together to filter objects.
Parameters:
-
data(dict[int, T]) –The data dictionary to query.
-
populate(Callable[[], Awaitable[None]]) –A coroutine to populate the data so we don't have a complete dataset before using "async for" loops.
-
filters(list[Callable[[T], Any]] | None, default:None) –A list of filters to apply to the queryset.
Methods:
-
filter–Return a queryset of objects that match the given filter.
-
get–Get the first object that matches the given filter.
-
aget–Asynchronously get the first object that matches the given filter.
-
first–Return the first object in the queryset.
-
afirst–Asynchronously return the first object in the queryset.
RGBLoadsController
¶
RGBLoadsController(vantage: Vantage)
Bases: Controller[RGBLoadTypes]
RGB loads controller.
Attributes:
-
on(QuerySet[RGBLoadTypes]) –Return a queryset of all RGB loads that are turned on.
-
off(QuerySet[RGBLoadTypes]) –Return a queryset of all RGB loads that are turned off.
StationsController
¶
StationsController(vantage: Vantage)
Bases: Controller[StationObject]
Stations controller.
Stations typically represent keypads or remote relays. It is mostly useful to know about these devices so we can set up a proper device hierarchy.
TemperaturesController
¶
TemperaturesController(vantage: Vantage)
Bases: Controller[Temperature]
Temperature device controller.
Temperature devices are device that measure or control temperature.