Move core Sonos functionality out of entities (#50277)
This commit is contained in:
parent
0fdc50408a
commit
d6a202bd74
9 changed files with 733 additions and 839 deletions
|
@ -48,6 +48,9 @@ class SonosEntity(Entity):
|
|||
self.async_write_ha_state,
|
||||
)
|
||||
)
|
||||
async_dispatcher_send(
|
||||
self.hass, f"{SONOS_ENTITY_CREATED}-{self.soco.uid}", self.platform.domain
|
||||
)
|
||||
|
||||
@property
|
||||
def soco(self) -> SoCo:
|
||||
|
@ -76,14 +79,3 @@ class SonosEntity(Entity):
|
|||
def should_poll(self) -> bool:
|
||||
"""Return that we should not be polled (we handle that internally)."""
|
||||
return False
|
||||
|
||||
|
||||
class SonosSensorEntity(SonosEntity):
|
||||
"""Representation of a Sonos sensor entity."""
|
||||
|
||||
async def async_added_to_hass(self) -> None:
|
||||
"""Handle common setup when added to hass."""
|
||||
await super().async_added_to_hass()
|
||||
async_dispatcher_send(
|
||||
self.hass, f"{SONOS_ENTITY_CREATED}-{self.soco.uid}", self.platform.domain
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue