From 7408bc0fa35f2158dbed144717d090cfb28da004 Mon Sep 17 00:00:00 2001 From: Jonny Bergdahl Date: Mon, 15 Jul 2024 17:43:57 +0200 Subject: [PATCH] Fix unload entry bug Version 1.0.1 --- custom_components/growcube/__init__.py | 5 ++++- custom_components/growcube/manifest.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/custom_components/growcube/__init__.py b/custom_components/growcube/__init__.py index 0835374..b25c99a 100644 --- a/custom_components/growcube/__init__.py +++ b/custom_components/growcube/__init__.py @@ -71,7 +71,10 @@ async def async_unload_entry(hass: HomeAssistant, entry: dict): """Unload the Growcube entry.""" client = hass.data[DOMAIN][entry.entry_id] client.disconnect() - return True + unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS) + if unload_ok: + hass.data[DOMAIN].pop(entry.entry_id) + return unload_ok diff --git a/custom_components/growcube/manifest.json b/custom_components/growcube/manifest.json index c2e98d0..10bac0f 100644 --- a/custom_components/growcube/manifest.json +++ b/custom_components/growcube/manifest.json @@ -10,5 +10,5 @@ "requirements": [ "growcube-client==1.2.2" ], - "version": "1.0.0" + "version": "1.0.1" }