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:
jjlawren 2021-05-28 05:07:58 -05:00 committed by GitHub
parent e45196f9c9
commit 39e62f9c90
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 17 deletions

View file

@ -1,7 +1,6 @@
"""Entity representing a Sonos battery level."""
from __future__ import annotations
import datetime
import logging
from homeassistant.components.sensor import SensorEntity
@ -50,7 +49,7 @@ class SonosBatteryEntity(SonosEntity, SensorEntity):
"""Get the unit of measurement."""
return PERCENTAGE
async def async_update(self, now: datetime.datetime | None = None) -> None:
async def async_update(self) -> None:
"""Poll the device for the current state."""
await self.speaker.async_poll_battery()