(hass, data, message)
return {'devices': devices}
Handle /user/devices/query request.

    https://yandex.ru/dev/dialogs/alice/doc/smart-home/reference/post-devices-query-docpage/
Handle /user/devices/query request.
Handle / user / devices / query request .
async def async_devices_query(hass, data, message):
    """Handle /user/devices/query request.

    https://yandex.ru/dev/dialogs/alice/doc/smart-home/reference/post-devices-query-docpage/
    """
    devices = []
    for device in message.get('devices', []):
        entity_id = device['id']
        state = hass.states.get(entity_id)

        if state is None:
            devices.append({
                'id': entity_id,
                'error_code': ERR_DEVICE_UNREACHABLE
            })
            continue

        entity = YandexEntity(hass, data.config, state)
        if not entity.should_expose:
            _LOGGER.warning(
                f'State requested for unexposed entity {entity.entity_id}. Please either expose the entity via '
                f'filters in component configuration or delete the device from Yandex.'
            )

        devices.append(entity.query_serialize())

    return {'devices': devices}
async def async_devices_query ( hass , data , message ) : devices = [ ] for device in message . get ( 'devices' , [ ] ) : entity_id = device [ 'id' ] state = hass . states . get ( entity_id ) if state is None : devices . append ( { 'id' : entity_id , 'error_code' : ERR_DEVICE_UNREACHABLE } ) continue entity = YandexEntity ( hass , data . config , state ) if not entity . should_expose : _LOGGER . warning ( f'State requested for unexposed entity {entity.entity_id}. Please either expose the entity via ' f'filters in component configuration or delete the device from Yandex.' ) devices . append ( entity . query_serialize ( ) ) return { 'devices' : devices }