@@ -133,7 +133,7 @@ async def async_init(self):
133
133
room_name = room ['name' ]
134
134
135
135
for device in room ['devices' ]:
136
- if device [ 'type' ]. startswith ( 'devices.types.smart_speaker' ) or device [ 'type' ]. endswith ( 'yandex.module' ):
136
+ if self . _is_supported_device ( device ):
137
137
device ['room' ] = room_name
138
138
self .devices .append (Device .from_dict (device ))
139
139
@@ -236,6 +236,25 @@ async def clear_scenarios(self):
236
236
except Exception :
237
237
_LOGGER .exception (f'Ошибка удаления сценария { scenario_name !r} ' )
238
238
239
+ @staticmethod
240
+ def _is_supported_device (device : dict [str , Any ]) -> bool :
241
+ device_type = device .get ('type' , '' )
242
+
243
+ # devices.types.smart_speaker.yandex.station.mini_2
244
+ # devices.types.smart_speaker.yandex.station_2
245
+ if device_type .startswith ('devices.types.smart_speaker' ):
246
+ return True
247
+
248
+ # devices.types.media_device.tv.yandex.magritte
249
+ if device_type .startswith ('devices.types.media_device.tv.yandex' ):
250
+ return True
251
+
252
+ # devices.types.media_device.dongle.yandex.module_2
253
+ if 'dongle.yandex.module' in device_type :
254
+ return True
255
+
256
+ return False
257
+
239
258
240
259
class EventStream :
241
260
def __init__ (
@@ -319,6 +338,8 @@ async def _on_message(self, payload: dict[Any, Any]):
319
338
continue
320
339
321
340
if cap_state ['instance' ] in ['text_action' , 'phrase_action' ] and INTENT_ID_MARKER in cap_state ['value' ]:
341
+ _LOGGER .debug (f'Интент обнаружен в событии: { dev !r} ' )
342
+
322
343
for device in self ._quasar .devices :
323
344
if device .id != dev ['id' ] or not device .yandex_station_id :
324
345
continue
0 commit comments