Allow per-device removal from the integration
Some checks are pending
Validate / validate-hacs (push) Waiting to run

HA blocks "Delete device" (and the equivalent
config/device_registry/remove_config_entry WS call) unless an
integration implements async_remove_config_entry_device. Add the
hook returning True so users can prune devices that are gone from
their Samsung Find account without editing the registry by hand.
A returning device with the same dvceID will be recreated on the
next coordinator setup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jeena 2026-05-05 07:02:31 +00:00
parent 4c26792c37
commit cddc1e9d72

View file

@ -90,6 +90,18 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
)
return True
async def async_remove_config_entry_device(
hass: HomeAssistant, entry: ConfigEntry, device
) -> bool:
"""Allow the user to remove a device from this config entry.
Returning True unconditionally lets HA delete the device + its entities
from the registry. If the same dvceID later reappears in Samsung's
response, the next setup will recreate fresh entries for it.
"""
return True
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
unload_success = await hass.config_entries.async_unload_platforms(entry, PLATFORMS)