Finish cleanup of deprecated ring update service (#125810)
This commit is contained in:
parent
70ebf2f5d8
commit
02e392e215
2 changed files with 1 additions and 15 deletions
|
@ -99,21 +99,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: RingConfigEntry) -> bool
|
||||||
|
|
||||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||||
|
|
||||||
if hass.services.has_service(DOMAIN, "update"):
|
|
||||||
return True
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||||
"""Unload Ring entry."""
|
"""Unload Ring entry."""
|
||||||
unload_ok = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
|
||||||
|
|
||||||
if len(hass.config_entries.async_loaded_entries(DOMAIN)) == 1:
|
|
||||||
# This is the last loaded entry, clean up service
|
|
||||||
hass.services.async_remove(DOMAIN, "update")
|
|
||||||
|
|
||||||
return unload_ok
|
|
||||||
|
|
||||||
|
|
||||||
async def async_remove_config_entry_device(
|
async def async_remove_config_entry_device(
|
||||||
|
|
|
@ -37,10 +37,5 @@
|
||||||
"default": "mdi:alarm-bell"
|
"default": "mdi:alarm-bell"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
"services": {
|
|
||||||
"update": {
|
|
||||||
"service": "mdi:refresh"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue