Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit af03db8

Browse files
check if service exists before removing (#185)
1 parent 23200c0 commit af03db8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

custom_components/multimatic/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ async def async_unload_services(hass, entry: ConfigEntry):
106106
key = service_key
107107
if serial:
108108
key += f"_{serial}"
109-
hass.services.async_remove(DOMAIN, key)
109+
if hass.services.has_service(DOMAIN, key):
110+
hass.services.async_remove(DOMAIN, key)
110111

111112

112113
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:

0 commit comments

Comments
 (0)