|
12 | 12 | from zigpy.quirks.v2 import (
|
13 | 13 | BinarySensorMetadata,
|
14 | 14 | CustomDeviceV2,
|
15 |
| - EntityType, |
16 | 15 | NumberMetadata,
|
17 | 16 | SwitchMetadata,
|
18 | 17 | WriteAttributeButtonMetadata,
|
|
107 | 106 | )
|
108 | 107 |
|
109 | 108 | QUIRKS_ENTITY_META_TO_ENTITY_CLASS = {
|
110 |
| - ( |
111 |
| - Platform.BUTTON, |
112 |
| - WriteAttributeButtonMetadata, |
113 |
| - EntityType.CONFIG, |
114 |
| - ): button.WriteAttributeButton, |
115 |
| - ( |
116 |
| - Platform.BUTTON, |
117 |
| - WriteAttributeButtonMetadata, |
118 |
| - EntityType.STANDARD, |
119 |
| - ): button.WriteAttributeButton, |
120 |
| - ( |
121 |
| - Platform.BUTTON, |
122 |
| - WriteAttributeButtonMetadata, |
123 |
| - EntityType.DIAGNOSTIC, |
124 |
| - ): button.WriteAttributeButton, |
125 |
| - ( |
126 |
| - Platform.BUTTON, |
127 |
| - ZCLCommandButtonMetadata, |
128 |
| - EntityType.CONFIG, |
129 |
| - ): button.Button, |
130 |
| - ( |
131 |
| - Platform.BUTTON, |
132 |
| - ZCLCommandButtonMetadata, |
133 |
| - EntityType.DIAGNOSTIC, |
134 |
| - ): button.Button, |
135 |
| - ( |
136 |
| - Platform.BUTTON, |
137 |
| - ZCLCommandButtonMetadata, |
138 |
| - EntityType.STANDARD, |
139 |
| - ): button.Button, |
140 |
| - ( |
141 |
| - Platform.BINARY_SENSOR, |
142 |
| - BinarySensorMetadata, |
143 |
| - EntityType.CONFIG, |
144 |
| - ): binary_sensor.BinarySensor, |
145 |
| - ( |
146 |
| - Platform.BINARY_SENSOR, |
147 |
| - BinarySensorMetadata, |
148 |
| - EntityType.DIAGNOSTIC, |
149 |
| - ): binary_sensor.BinarySensor, |
150 |
| - ( |
151 |
| - Platform.BINARY_SENSOR, |
152 |
| - BinarySensorMetadata, |
153 |
| - EntityType.STANDARD, |
154 |
| - ): binary_sensor.BinarySensor, |
155 |
| - ( |
156 |
| - Platform.SENSOR, |
157 |
| - ZCLEnumMetadata, |
158 |
| - EntityType.DIAGNOSTIC, |
159 |
| - ): sensor.EnumSensor, |
160 |
| - ( |
161 |
| - Platform.SENSOR, |
162 |
| - ZCLEnumMetadata, |
163 |
| - EntityType.STANDARD, |
164 |
| - ): sensor.EnumSensor, |
165 |
| - ( |
166 |
| - Platform.SENSOR, |
167 |
| - ZCLSensorMetadata, |
168 |
| - EntityType.DIAGNOSTIC, |
169 |
| - ): sensor.Sensor, |
170 |
| - ( |
171 |
| - Platform.SENSOR, |
172 |
| - ZCLSensorMetadata, |
173 |
| - EntityType.STANDARD, |
174 |
| - ): sensor.Sensor, |
175 |
| - ( |
176 |
| - Platform.SELECT, |
177 |
| - ZCLEnumMetadata, |
178 |
| - EntityType.CONFIG, |
179 |
| - ): select.ZCLEnumSelectEntity, |
180 |
| - ( |
181 |
| - Platform.SELECT, |
182 |
| - ZCLEnumMetadata, |
183 |
| - EntityType.STANDARD, |
184 |
| - ): select.ZCLEnumSelectEntity, |
185 |
| - ( |
186 |
| - Platform.SELECT, |
187 |
| - ZCLEnumMetadata, |
188 |
| - EntityType.DIAGNOSTIC, |
189 |
| - ): select.ZCLEnumSelectEntity, |
190 |
| - ( |
191 |
| - Platform.NUMBER, |
192 |
| - NumberMetadata, |
193 |
| - EntityType.CONFIG, |
194 |
| - ): number.NumberConfigurationEntity, |
195 |
| - ( |
196 |
| - Platform.NUMBER, |
197 |
| - NumberMetadata, |
198 |
| - EntityType.DIAGNOSTIC, |
199 |
| - ): number.NumberConfigurationEntity, |
200 |
| - ( |
201 |
| - Platform.NUMBER, |
202 |
| - NumberMetadata, |
203 |
| - EntityType.STANDARD, |
204 |
| - ): number.NumberConfigurationEntity, |
205 |
| - ( |
206 |
| - Platform.SWITCH, |
207 |
| - SwitchMetadata, |
208 |
| - EntityType.CONFIG, |
209 |
| - ): switch.ConfigurableAttributeSwitch, |
210 |
| - ( |
211 |
| - Platform.SWITCH, |
212 |
| - SwitchMetadata, |
213 |
| - EntityType.STANDARD, |
214 |
| - ): switch.ConfigurableAttributeSwitch, |
| 109 | + (Platform.BUTTON, WriteAttributeButtonMetadata): button.WriteAttributeButton, |
| 110 | + (Platform.BUTTON, ZCLCommandButtonMetadata): button.Button, |
| 111 | + (Platform.BINARY_SENSOR, BinarySensorMetadata): binary_sensor.BinarySensor, |
| 112 | + (Platform.SENSOR, ZCLEnumMetadata): sensor.EnumSensor, |
| 113 | + (Platform.SENSOR, ZCLSensorMetadata): sensor.Sensor, |
| 114 | + (Platform.SELECT, ZCLEnumMetadata): select.ZCLEnumSelectEntity, |
| 115 | + (Platform.NUMBER, NumberMetadata): number.NumberConfigurationEntity, |
| 116 | + (Platform.SWITCH, SwitchMetadata): switch.ConfigurableAttributeSwitch, |
215 | 117 | }
|
216 | 118 |
|
217 | 119 |
|
@@ -338,7 +240,7 @@ def discover_quirks_v2_entities(self, device: Device) -> Iterator[PlatformEntity
|
338 | 240 | platform = Platform(entity_metadata.entity_platform.value)
|
339 | 241 | metadata_type = type(entity_metadata)
|
340 | 242 | entity_class = QUIRKS_ENTITY_META_TO_ENTITY_CLASS.get(
|
341 |
| - (platform, metadata_type, entity_metadata.entity_type) |
| 243 | + (platform, metadata_type) |
342 | 244 | )
|
343 | 245 |
|
344 | 246 | if entity_class is None:
|
|
0 commit comments