Skip to content
This repository was archived by the owner on Aug 4, 2025. It is now read-only.

Commit 507511f

Browse files
committed
Added fix from VolantisDev#79
1 parent e0fe7a6 commit 507511f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

custom_components/chore_helper/chore.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,10 @@ async def async_will_remove_from_hass(self) -> None:
153153
"""When sensor is removed from HA, remove it and its calendar entity."""
154154
await super().async_will_remove_from_hass()
155155
del self.hass.data[const.DOMAIN][const.SENSOR_PLATFORM][self.entity_id]
156-
self.hass.data[const.DOMAIN][const.CALENDAR_PLATFORM].remove_entity(
157-
self.entity_id
158-
)
156+
if const.CALENDAR_PLATFORM in self.hass.data[const.DOMAIN]:
157+
self.hass.data[const.DOMAIN][const.CALENDAR_PLATFORM].remove_entity(
158+
self.entity_id
159+
)
159160

160161
@property
161162
def unique_id(self) -> str:

0 commit comments

Comments
 (0)