(self, path)
Write image to file.

        :param path: Path to write file
Write image to file.
Write image to file .
def image_to_file(self, path):
        """
        Write image to file.

        :param path: Path to write file
        """
        _LOGGER.debug("Writing image from %s to %s", self.name, path)
        response = self.get_media()
        if response.status_code == 200:
            with open(path, "wb") as imgfile:
                copyfileobj(response.raw, imgfile)
        else:
            _LOGGER.error(
                "Cannot write image to file, response %s", response.status_code
            )
def image_to_file ( self , path ) : _LOGGER . debug ( "Writing image from %s to %s" , self . name , path ) response = self . get_media ( ) if response . status_code == 200 : with open ( path , "wb" ) as imgfile : copyfileobj ( response . raw , imgfile ) else : _LOGGER . error ( "Cannot write image to file, response %s" , response . status_code )