Improve Sonos polling (#51170)
* Improve Sonos polling Warn user if polling is being used Provide callback IP:port to help user fix networking Fix radio handling when polling (no event payload) Clarify dispatch target to reflect polling action * Lint * Revert method removal
This commit is contained in:
parent
e45196f9c9
commit
39e62f9c90
7 changed files with 35 additions and 17 deletions
|
@ -293,13 +293,12 @@ class SonosMediaPlayerEntity(SonosEntity, MediaPlayerEntity):
|
|||
return STATE_PLAYING
|
||||
return STATE_IDLE
|
||||
|
||||
async def async_update(self, now: datetime.datetime | None = None) -> None:
|
||||
async def async_update(self) -> None:
|
||||
"""Retrieve latest state."""
|
||||
await self.hass.async_add_executor_job(self._update, now)
|
||||
await self.hass.async_add_executor_job(self._update)
|
||||
|
||||
def _update(self, now: datetime.datetime | None = None) -> None:
|
||||
def _update(self) -> None:
|
||||
"""Retrieve latest state."""
|
||||
_LOGGER.debug("Polling speaker %s", self.speaker.zone_name)
|
||||
try:
|
||||
self.speaker.update_groups()
|
||||
self.speaker.update_volume()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue