(self, request: Request)
return Response(text=f'OK: {device_count}', status=200)
Handle Yandex Smart Home Get requests.
Handle Yandex Smart Home Get requests.
Handle Yandex Smart Home Get requests .
async def get(self, request: Request) -> Response:
        """Handle Yandex Smart Home Get requests."""
        _LOGGER.debug('Request: %s (GET)' % request.url)

        if not self._is_direct_connection(request):
            return Response(text='Error: Integration is not enabled or use cloud connection', status=503)

        data = RequestData(self._get_config(request), None, 'ping')
        devices_sync_response = await async_devices(request.app['hass'], data, {})
        device_count = len(devices_sync_response['devices'])

        return Response(text=f'OK: {device_count}', status=200)
async def get ( self , request : Request ) -> Response : _LOGGER . debug ( 'Request: %s (GET)' % request . url ) if not self . _is_direct_connection ( request ) : return Response ( text = 'Error: Integration is not enabled or use cloud connection' , status = 503 ) data = RequestData ( self . _get_config ( request ) , None , 'ping' ) devices_sync_response = await async_devices ( request . app [ 'hass' ] , data , { } ) device_count = len ( devices_sync_response [ 'devices' ] ) return Response ( text = f'OK: {device_count}' , status = 200 )