(self)
Cleanup backup files.
Cleanup backup files.
Cleanup backup files .
def cleanup(self) -> None:
        """Cleanup backup files."""
        if not os.path.exists(self.backup_path):
            return

        shutil.rmtree(self.backup_path)

        # Wait for the folder to be removed
        while os.path.exists(self.backup_path):
            sleep(0.1)
        self.hacs.log.debug("Backup dir %s cleared", self.backup_path)
def cleanup ( self ) -> None : if not os . path . exists ( self . backup_path ) : return shutil . rmtree ( self . backup_path ) # Wait for the folder to be removed while os . path . exists ( self . backup_path ) : sleep ( 0.1 ) self . hacs . log . debug ( "Backup dir %s cleared" , self . backup_path )