tache / homeassistant-kidde

A custom component for Kidde HomeSafe.
MIT License
30 stars 3 forks source link

Add ability to delete a device from HA #33

Open tache opened 3 months ago

tache commented 3 months ago

A user shold be able to remove a device from Home Assistant without any back editing of the registry.

tache commented 3 months ago

Okay, adding this here ... scratching my head on it ... sort of working

Listed below is the __init__.py file. I added in the async_remove_config_entry_device and logging to debug. This code is to delete a device. Either an existing device that is present, or a missing device removed from the user's installation.

What I cannot figure out is the result Device / service not found. When doing the action, the device deletes sucessfully in the device registery, but responds with the error. I beleive the code that calls the async_remove_config_entry_device is the HA's device_registry.py , line 134 ... I cannot figure out that the error message gets popped. I am wodering if there is a callback that I am missing.

You can simulate the removing of a sensor by ...

Here are the three dialog boxes that are presented when you delete.


In the HA device page under Device info

Screen Shot 2024-09-02 at 5 06 23 PM

Popup when selecting DELETE

Screen Shot 2024-09-02 at 5 09 38 PM

and the resulting response after selecting DELETE.

Screen Shot 2024-09-02 at 5 09 43 PM