Skip to content

Fix issue #770: Add async_remove_config_entry_device to support deleting devices from UI #1461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions custom_components/ble_monitor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers import device_registry, entity_registry
from homeassistant.helpers.device_registry import DeviceEntry
from homeassistant.util import dt

from .ble_parser import BleParser
Expand Down Expand Up @@ -425,6 +426,20 @@ async def async_parse_data_service(hass: HomeAssistant, service_data):
)


async def async_remove_config_entry_device(
hass: HomeAssistant, config_entry: ConfigEntry, device_entry: DeviceEntry
) -> bool:
"""Remove a config entry from a device."""
_LOGGER.debug(
"Removing BLE monitor device %s from device registry",
device_entry.id
)

# Return True to indicate that this integration is ready to have the device removed
# The device registry will take care of actual removal when appropriate
return True


class BLEmonitor:
"""BLE scanner."""

Expand Down
Loading