hassio/hassos.py
async def _download_raucb(self, version: str) -> None:
        """Download rauc bundle (OTA) from github."""
        url = URL_HASSOS_OTA.format(version=version, board=self.board)
        raucb = Path(self.sys_config.path_tmp, f"hassos-{version}.raucb")

        try:
            _LOGGER.info("Fetch OTA update from %s", url)
            async with self.sys_websession.get(url) as request:
                if request.status != 200:
                    raise HassOSUpdateError()

                # Download RAUCB file
                with raucb.open("wb") as ota_file:
                    while True:
                        chunk = await request.content.read(1_048_576)
                        if not chunk:
                            break
                        ota_file.write(chunk)

            _LOGGER.info("OTA update is downloaded on %s", raucb)
            return raucb

        except (aiohttp.ClientError, asyncio.TimeoutError) as err:
            _LOGGER.warning("Can't fetch versions from %s: %s", url, err)

        except OSError as err:
            _LOGGER.error("Can't write OTA file: %s", err)

        raise HassOSUpdateError()
Download rauc bundle (OTA) from github.
Download rauc bundle (OTA) from github.
Download rauc bundle ( OTA ) from github .
async def _download_raucb(self, version: str) -> None:
        url = URL_HASSOS_OTA.format(version=version, board=self.board)
        raucb = Path(self.sys_config.path_tmp, f"hassos-{version}.raucb")
        try:
            _LOGGER.info("Fetch OTA update from %s", url)
            async with self.sys_websession.get(url) as request:
                if request.status != 200:
                    raise HassOSUpdateError()
                with raucb.open("wb") as ota_file:
                    while True:
                        chunk = await request.content.read(1_048_576)
                        if not chunk:
                            break
                        ota_file.write(chunk)
            _LOGGER.info("OTA update is downloaded on %s", raucb)
            return raucb
        except (aiohttp.ClientError, asyncio.TimeoutError) as err:
            _LOGGER.warning("Can't fetch versions from %s: %s", url, err)
        except OSError as err:
            _LOGGER.error("Can't write OTA file: %s", err)
        raise HassOSUpdateError()
async def _download_raucb ( self , version : str ) -> None : url = URL_HASSOS_OTA . format ( version = version , board = self . board ) raucb = Path ( self . sys_config . path_tmp , f"hassos-{version}.raucb" ) try : _LOGGER . info ( "Fetch OTA update from %s" , url ) async with self . sys_websession . get ( url ) as request : if request . status != 200 : raise HassOSUpdateError ( ) with raucb . open ( "wb" ) as ota_file : while True : chunk = await request . content . read ( 1_048_576 ) if not chunk : break ota_file . write ( chunk ) _LOGGER . info ( "OTA update is downloaded on %s" , raucb ) return raucb except ( aiohttp . ClientError , asyncio . TimeoutError ) as err : _LOGGER . warning ( "Can't fetch versions from %s: %s" , url , err ) except OSError as err : _LOGGER . error ( "Can't write OTA file: %s" , err ) raise HassOSUpdateError ( )
Download rauc bundle (OTA) from github.
Download rauc bundle ( OTA ) from github .
"""Download rauc bundle (OTA) from github.""" # Download RAUCB file
self
version
str