    def _get_bermuda_device_from_registry(self, registry_id: str) -> BermudaDevice | None:
        """
        Given a device registry device id, return the associated MAC address.

        Returns None if the id can not be resolved to a mac.
        """
        devreg = dr.async_get(self.hass)
        device = devreg.async_get(registry_id)
        device_address = None
        if device is not None:
            for connection in device.connections:
                if connection[0] in {
                    DOMAIN_PRIVATE_BLE_DEVICE,
                    dr.CONNECTION_BLUETOOTH,
                    "ibeacon",
                }:
                    device_address = connection[1]
                    break
            if device_address is not None:
                return self.coordinator.devices[device_address.lower()]
        # We couldn't match the HA device id to a bermuda device mac.
        return None
Given a device registry device id, return the associated MAC address.

Returns None if the id can not be resolved to a mac.
custom_components/bermuda/config_flow.py