async def clear_out_removed_repositories(self): """Clear out blaclisted repositories.""" need_to_save = False for removed in list_removed_repositories(): repository = self.get_by_name(removed.repository) if repository is not None: if repository.data.installed and removed.removal_type != "critical": self.logger.warning( f"You have {repository.data.full_name} installed with HACS " + "this repository has been removed, please consider removing it. " + f"Removal reason ({removed.removal_type})") else: need_to_save = True repository.remove() if need_to_save: await self.data.async_write()
def test_list_removed_repositories(): list_removed_repositories()
async def hacs_removed(hass, connection, msg): """Get information about removed repositories.""" content = [] for repo in list_removed_repositories(): content.append(repo.to_json()) connection.send_message(websocket_api.result_message(msg["id"], content))