frenck / spook

A scary 👻 powerful toolbox 🧰 for Home Assistant 🏡
https://spook.boo
MIT License
381 stars 36 forks source link

No groups are spooky during reboot #161

Closed pimw1 closed 12 months ago

pimw1 commented 12 months ago

Hi,

When no helper groups are defined, spooky gets really scared during restarting home assistant. It will spook out the error below. When creating a helper light group with 1 member (1 light), spooky is satisfied during restarting home assistant and the error is gone.

This error originated from a custom integration.

Logger: homeassistant
Source: custom_components/spook/repairs/group_unknown_members.py:46
Integration: Spook (documentation, issues)
First occurred: 14:58:36 (1 occurrences)
Last logged: 14:58:36

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/spook/__init__.py", line 32, in _ghost_busters
    await repairs.async_setup()
  File "/config/custom_components/spook/repairs/__init__.py", line 186, in async_setup
    await self.async_activate(module.SpookRepair(self.hass))
  File "/config/custom_components/spook/repairs/__init__.py", line 195, in async_activate
    await repair.async_activate()
  File "/config/custom_components/spook/repairs/group_unknown_members.py", line 46, in async_activate
    self._entity_platforms = self.hass.data[DATA_ENTITY_PLATFORM][self.domain]
KeyError: 'group'
pimw1 commented 12 months ago

Thanks for your effort Frenck! After updating to v0.12.345, the fix is not working: spookey is still scared during reboot.

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/config/custom_components/spook/__init__.py", line 32, in _ghost_busters
    await repairs.async_setup()
  File "/config/custom_components/spook/repairs/__init__.py", line 194, in async_setup
    await self.async_activate(module.SpookRepair(self.hass))
  File "/config/custom_components/spook/repairs/__init__.py", line 203, in async_activate
    await repair.async_activate()
  File "/config/custom_components/spook/repairs/group_unknown_members.py", line 46, in async_activate
    self._entity_platforms = self.hass.data[DATA_ENTITY_PLATFORM][self.domain]
KeyError: 'group'

The spook is whispering to me that the error might be related to the startup instead of the shutdown ;)

frenck commented 12 months ago

Makes sense, thanks! 👍

pimw1 commented 12 months ago

163 Solved it. My spooky is not scared anymore and happily boooo-ing around town here. Thanks!