1 """Utility methods for the Insteon platform."""
3 from collections.abc
import Iterable
5 from pyinsteon.device_types.device_base
import Device
6 from pyinsteon.device_types.ipdb
import (
7 AccessControl_Morningstar,
8 ClimateControl_Thermostat,
9 ClimateControl_WirelessThermostat,
10 DimmableLightingControl,
11 DimmableLightingControl_Dial,
12 DimmableLightingControl_DinRail,
13 DimmableLightingControl_FanLinc,
14 DimmableLightingControl_I3_KeypadLinc_4,
15 DimmableLightingControl_InLineLinc01,
16 DimmableLightingControl_InLineLinc02,
17 DimmableLightingControl_KeypadLinc_6,
18 DimmableLightingControl_KeypadLinc_8,
19 DimmableLightingControl_LampLinc,
20 DimmableLightingControl_OutletLinc,
21 DimmableLightingControl_SwitchLinc01,
22 DimmableLightingControl_SwitchLinc02,
23 DimmableLightingControl_ToggleLinc,
24 EnergyManagement_LoadController,
25 SecurityHealthSafety_DoorSensor,
26 SecurityHealthSafety_LeakSensor,
27 SecurityHealthSafety_MotionSensor,
28 SecurityHealthSafety_OpenCloseSensor,
29 SecurityHealthSafety_Smokebridge,
30 SensorsActuators_IOLink,
31 SwitchedLightingControl,
32 SwitchedLightingControl_ApplianceLinc,
33 SwitchedLightingControl_DinRail,
34 SwitchedLightingControl_I3Outlet,
35 SwitchedLightingControl_InLineLinc01,
36 SwitchedLightingControl_InLineLinc02,
37 SwitchedLightingControl_KeypadLinc_6,
38 SwitchedLightingControl_KeypadLinc_8,
39 SwitchedLightingControl_OnOffOutlet,
40 SwitchedLightingControl_OutletLinc,
41 SwitchedLightingControl_SwitchLinc01,
42 SwitchedLightingControl_SwitchLinc02,
43 SwitchedLightingControl_ToggleLinc,
52 DEVICE_PLATFORM: dict[Device, dict[Platform, Iterable[int]]] = {
53 AccessControl_Morningstar: {Platform.LOCK: [1]},
54 DimmableLightingControl: {Platform.LIGHT: [1]},
55 DimmableLightingControl_Dial: {Platform.LIGHT: [1]},
56 DimmableLightingControl_DinRail: {Platform.LIGHT: [1]},
57 DimmableLightingControl_FanLinc: {Platform.LIGHT: [1], Platform.FAN: [2]},
58 DimmableLightingControl_InLineLinc01: {Platform.LIGHT: [1]},
59 DimmableLightingControl_InLineLinc02: {Platform.LIGHT: [1]},
60 DimmableLightingControl_I3_KeypadLinc_4: {
61 Platform.LIGHT: [1, 2, 3, 4],
63 DimmableLightingControl_KeypadLinc_6: {
65 Platform.SWITCH: [3, 4, 5, 6],
67 DimmableLightingControl_KeypadLinc_8: {
69 Platform.SWITCH: range(2, 9),
71 DimmableLightingControl_LampLinc: {Platform.LIGHT: [1]},
72 DimmableLightingControl_OutletLinc: {Platform.LIGHT: [1]},
73 DimmableLightingControl_SwitchLinc01: {Platform.LIGHT: [1]},
74 DimmableLightingControl_SwitchLinc02: {Platform.LIGHT: [1]},
75 DimmableLightingControl_ToggleLinc: {Platform.LIGHT: [1]},
76 EnergyManagement_LoadController: {
78 Platform.BINARY_SENSOR: [2],
80 SecurityHealthSafety_DoorSensor: {Platform.BINARY_SENSOR: [1, 3, 4]},
81 SecurityHealthSafety_LeakSensor: {Platform.BINARY_SENSOR: [2, 4]},
82 SecurityHealthSafety_MotionSensor: {Platform.BINARY_SENSOR: [1, 2, 3]},
83 SecurityHealthSafety_OpenCloseSensor: {Platform.BINARY_SENSOR: [1]},
84 SecurityHealthSafety_Smokebridge: {Platform.BINARY_SENSOR: [1, 2, 3, 4, 6, 7]},
85 SensorsActuators_IOLink: {Platform.SWITCH: [1], Platform.BINARY_SENSOR: [2]},
86 SwitchedLightingControl: {Platform.SWITCH: [1]},
87 SwitchedLightingControl_ApplianceLinc: {Platform.SWITCH: [1]},
88 SwitchedLightingControl_DinRail: {Platform.SWITCH: [1]},
89 SwitchedLightingControl_I3Outlet: {Platform.SWITCH: [1, 2]},
90 SwitchedLightingControl_InLineLinc01: {Platform.SWITCH: [1]},
91 SwitchedLightingControl_InLineLinc02: {Platform.SWITCH: [1]},
92 SwitchedLightingControl_KeypadLinc_6: {
93 Platform.SWITCH: [1, 3, 4, 5, 6],
95 SwitchedLightingControl_KeypadLinc_8: {
96 Platform.SWITCH: range(1, 9),
98 SwitchedLightingControl_OnOffOutlet: {Platform.SWITCH: [1, 2]},
99 SwitchedLightingControl_OutletLinc: {Platform.SWITCH: [1]},
100 SwitchedLightingControl_SwitchLinc01: {Platform.SWITCH: [1]},
101 SwitchedLightingControl_SwitchLinc02: {Platform.SWITCH: [1]},
102 SwitchedLightingControl_ToggleLinc: {Platform.SWITCH: [1]},
103 ClimateControl_Thermostat: {Platform.CLIMATE: [1]},
104 ClimateControl_WirelessThermostat: {Platform.CLIMATE: [1]},
105 WindowCovering: {Platform.COVER: [1]},
106 X10Dimmable: {Platform.LIGHT: [1]},
107 X10OnOff: {Platform.SWITCH: [1]},
108 X10OnOffSensor: {Platform.BINARY_SENSOR: [1]},
113 """Return the HA platforms for a device type."""
114 return DEVICE_PLATFORM.get(type(device), {})
118 """Return the list of device groups for a platform."""
web.Response get(self, web.Request request, str config_key)
dict[Platform, Iterable[int]] get_device_platforms(device)
Iterable[int] get_device_platform_groups(Device device, Platform platform)