Skip to content

Commit

Permalink
🕹️ fix sub-entities for miir (#879)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Dec 2, 2022
1 parent f844990 commit 66684df
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions custom_components/xiaomi_miot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2186,6 +2186,11 @@ def __init__(self, miot_service=None, device=None, **kwargs):
self._act_turn_off = miot_service.get_action('turn_off')
self._attr_should_poll = False

async def async_added_to_hass(self):
await super().async_added_to_hass()
if self.is_main_entity:
await self.async_update_for_main_entity()

@property
def is_on(self):
"""Return True if entity is on."""
Expand Down

0 comments on commit 66684df

Please sign in to comment.