homeassistant/components/nest/camera_sdm.py
async def _handle_stream_refresh(self, now: datetime.datetime) -> None:
        """Alarm that fires to check if the stream should be refreshed."""
        if not self._stream:
            return
        _LOGGER.debug("Extending stream url")
        try:
            self._stream = await self._stream.extend_rtsp_stream()
        except ApiException as err:
            _LOGGER.debug("Failed to extend stream: %s", err)
            # Next attempt to catch a url will get a new one
            self._stream = None
            if self.stream:
                await self.stream.stop()
                self.stream = None
            return
        # Update the stream worker with the latest valid url
        if self.stream:
            self.stream.update_source(self._stream.rtsp_stream_url)
        self._schedule_stream_refresh()
Alarm that fires to check if the stream should be refreshed.
Alarm that fires to check if the stream should be refreshed.
Alarm that fires to check if the stream should be refreshed .
async def _handle_stream_refresh(self, now: datetime.datetime) -> None:
        if not self._stream:
            return
        _LOGGER.debug("Extending stream url")
        try:
            self._stream = await self._stream.extend_rtsp_stream()
        except ApiException as err:
            _LOGGER.debug("Failed to extend stream: %s", err)
            self._stream = None
            if self.stream:
                await self.stream.stop()
                self.stream = None
            return
        if self.stream:
            self.stream.update_source(self._stream.rtsp_stream_url)
        self._schedule_stream_refresh()
async def _handle_stream_refresh ( self , now : datetime . datetime ) -> None : if not self . _stream : return _LOGGER . debug ( "Extending stream url" ) try : self . _stream = await self . _stream . extend_rtsp_stream ( ) except ApiException as err : _LOGGER . debug ( "Failed to extend stream: %s" , err ) self . _stream = None if self . stream : await self . stream . stop ( ) self . stream = None return if self . stream : self . stream . update_source ( self . _stream . rtsp_stream_url ) self . _schedule_stream_refresh ( )
Alarm that fires to check if the stream should be refreshed.
Alarm that fires to check if the stream should be refreshed .
"""Alarm that fires to check if the stream should be refreshed.""" # Next attempt to catch a url will get a new one # Update the stream worker with the latest valid url
self
now
datetime.datetime