Devices¶
devices
¶
Device objects, one class per family of idDevicemodel.
The app picks a device's screen from idDevicemodel (and remoteControlCode,
the sub-model), never from idDevicetype. Every action ends up as an
(action, param) request resolved against the device's own command list
(see aioteleco.commands).
DEVICE_MODELS
module-attribute
¶
DEVICE_MODELS: dict[int, tuple[str, str]] = {
16: ("LMP", "On/off"),
17: ("DIM", "Dimmer"),
18: ("HEA", "Heater"),
19: ("FAN", "Fan"),
20: ("HEQ", "Heater 4 channels"),
21: ("PER", "Rolling shutter"),
22: ("CAN", "Gate"),
23: ("SER", "Garage door"),
24: ("SOL", "Awning"),
25: ("TEN", "Screen"),
26: ("RGB", "RGB light (presets)"),
27: ("PEG", "Pergola adjustable slats"),
28: ("AUD", "Audio"),
31: ("PEQ", "Pergola slats (open/stop/close)"),
32: ("COP", "RGB light"),
33: ("DYP", "Tunable white light"),
34: ("DMS", "Dimmer (slider)"),
41: ("", "Generic remote (buttons)"),
42: ("", "Generic remote (sliders)"),
43: ("GAK", "Garage door (ask)"),
44: ("RAS", "Retractable slats"),
45: ("ARS", "Automatic retractable slats"),
46: ("CRP", "RGB light (color rotation)"),
47: ("WIN", "Window"),
}
RGB_PRESETS
module-attribute
¶
Device
¶
Device(
hub: TelecoHub,
installation: Installation,
room: Room,
info: DeviceInfo,
)
Any device of an installation.
supports
¶
Does the device's command list contain this action (and param)?
OnOffDevice
¶
OnOffDevice(
hub: TelecoHub,
installation: Installation,
room: Room,
info: DeviceInfo,
)
Bases: Device
Light
¶
Light(
hub: TelecoHub,
installation: Installation,
room: Room,
info: DeviceInfo,
)
Bases: OnOffDevice
Dimmer
¶
Dimmer(
hub: TelecoHub,
installation: Installation,
room: Room,
info: DeviceInfo,
)
Bases: Light
Dimmers / heaters with 4 steps (POWER LEV1..LEV4) or a 0-100 LEVEL.
has_continuous_level
property
¶
has_continuous_level: bool
Only slider dimmers (model 34) take a free 0-100 level; the others have 4 steps.
set_level
async
¶
set_level(level: int) -> SendResult
Brightness 0..100; 0 turns the device off.
Slider dimmers (model 34) get the value itself (LEVEL <n>), like the app's
slider. Stepped dimmers get the nearest step (25/50/75/100): they also list a
parametric LEVEL command, but the box ignores it for them.
Heater
¶
Heater(
hub: TelecoHub,
installation: Installation,
room: Room,
info: DeviceInfo,
)
Bases: Dimmer
Fan
¶
Fan(
hub: TelecoHub,
installation: Installation,
room: Room,
info: DeviceInfo,
)
Bases: OnOffDevice
ColorLight
¶
ColorLight(
hub: TelecoHub,
installation: Installation,
room: Room,
info: DeviceInfo,
)
Bases: Light
RGB (32, 46) and tunable-white (33) lights driven by an ARGB string.
WhiteLight
¶
WhiteLight(
hub: TelecoHub,
installation: Installation,
room: Room,
info: DeviceInfo,
)
Bases: ColorLight
PresetRgbLight
¶
PresetRgbLight(
hub: TelecoHub,
installation: Installation,
room: Room,
info: DeviceInfo,
)
TravelTimes
dataclass
¶
Cover
¶
Cover(
hub: TelecoHub,
installation: Installation,
room: Room,
info: DeviceInfo,
)
Bases: Device
Open/stop/close devices: shutters, awnings, screens, gates, windows...
The box only takes OPEN, STOP and CLOSE. With travel_times set,
travel_to reaches any position by timing a move then sending STOP, and
position follows an estimate of where the cover is.
position
property
¶
position: int | None
Open percentage: the timed estimate when there is one, else as the app shows it.
The app (OpenStopCloseDeviceActionFragment) shows LEVEL while OPEN,
0 when CLOSE (whatever LEVEL says) and nothing when stopped midway.
estimated_position
property
¶
estimated_position: float | None
Position computed from the moves sent by this object (needs travel times).
direction
property
¶
direction: int
+1 while opening, -1 while closing, 0 otherwise (moves sent by this object).
A move counts as over once its full travel time has elapsed (needs
travel_times; without them a move lasts until the next command).
restore_position
¶
restore_position(percent: float | None) -> None
Seed the position estimate, e.g. from the last state saved by Home Assistant.
set_position
async
¶
set_position(percent: int) -> SendResult | None
Timed move with travel_to (covers have no position command).
travel_to
async
¶
travel_to(percent: int) -> None
Reach percent (0 closed .. 100 open) by timing a move, then STOP.
Needs travel_times. From an unknown position the cover first closes
completely. Timing is only as good as the latency between the two commands:
the local channel is much more precise than the cloud.
Slats
¶
Slats(
hub: TelecoHub,
installation: Installation,
room: Room,
info: DeviceInfo,
)
Bases: Cover
Pergola slats with steps 0/33/66/100 (models 27, 44, 45).
set_position
async
¶
set_position(percent: int) -> SendResult
Move to the nearest step (the app only offers 0/33/66/100).
Audio
¶
Audio(
hub: TelecoHub,
installation: Installation,
room: Room,
info: DeviceInfo,
)
Bases: OnOffDevice
color_string
¶
AxxxRxxxGxxxBxxx (A = brightness 0-100), as built by Utils.
parse_color
¶
Parse AxxxRxxxGxxxBxxx into ((r, g, b), brightness).
device_class
¶
device_class(info: DeviceInfo) -> type[Device]
Pick the class for a device (DeviceFactory#castDevice).