📡AR Smart IR Builder
✨ What’s New
đź› Bug Fix: Proper Home Assistant Registry Cleanup
Fixed a long-standing issue where deleting a device profile could leave behind ghost entries in Home Assistant’s entity and device registries.
Previously, even after all profiles were removed, Home Assistant could still report the integration as “in use,” forcing a full uninstall before the integration entry could be deleted.
🔍 Root Cause
Calling entity.async_remove() only removed entities from Home Assistant’s live state machine — it did not remove them from:
Entity Registry
Device Registry
Because Home Assistant checks registry entries (not live states) to determine whether a config entry still owns devices, stale records were preventing proper cleanup.
✅ What’s Fixed
Deleting a profile now:
Removes the entity from the Entity Registry
Removes the device from the Device Registry when no linked entities remain
Fully scrubs associated entities and devices during integration removal
Ensures config entries can be removed cleanly without manual intervention
🎉 Result
No more ghost devices.
No more stale registry entries.
No more uninstalling the integration just to clean up deleted profiles.
Clean profile deletion now works exactly as expected.