FutureTense / lock-manager

Home Assistant Lock Manager
55 stars 19 forks source link

ISSUE: Helper objects and automations aren't removed when integration is removed. #82

Closed jayscovill closed 3 years ago

jayscovill commented 3 years ago

Describe the bug When I removed the locks then the integration from Configuartion -> Integrations and HACS the hundreds of helper objects such as input_boolean. and input_datetime. that were created aren't removed from Configuration -> Helpers.

I would like to be able to remove them on mass but I can't find what file they are stored in in my HASS installation. I've searched under .storage but cannot locate those entries anywhere.

Environment (please complete the following information):

firstof9 commented 3 years ago

Did you check the packages directory? That's where the template'ed files get placed.

jayscovill commented 3 years ago

Yes, I've removed the files there but they are still persisting in the Helpers section.

firstof9 commented 3 years ago

And just to confirm the process you used you followed the steps:

  1. Navigated to Configuration -> Integrations
  2. Clicked the "Overflow menu" (3 dots)
  3. Selected "Delete" on the KeyMaster integration

That sound about right?

jayscovill commented 3 years ago

Yep, after deleting each lock from the integration.

firstof9 commented 3 years ago

Sounds like the unload_entry function didn't get fired like it's supposed to, this function has all the cleanup in it to remove the entities.

EDIT: Did you get a persistent notification stating it was "removing the lock and the files generated for it"?

jayscovill commented 3 years ago

No, no persistent notification.

jayscovill commented 3 years ago

So as another data point when I restart Hass the helper objects don't appear until after the loading integrations message disappears. Versus the others that I created that are there as soon as Hass has finished booting. So it appears there's still remnants of the integration lingering that are still being loaded. I don't see any mention of 'keymaster' in the logs though.

jayscovill commented 3 years ago

Gah, they were in core.entity_registry. I swear I'd check it...but problem solved. Thanks!