Use _attr_should_poll in components [h-i] (#77270)
This commit is contained in:
parent
a46c25d2c8
commit
2a8109304f
20 changed files with 38 additions and 120 deletions
|
@ -56,6 +56,7 @@ class IcloudDeviceBatterySensor(SensorEntity):
|
|||
|
||||
_attr_device_class = SensorDeviceClass.BATTERY
|
||||
_attr_native_unit_of_measurement = PERCENTAGE
|
||||
_attr_should_poll = False
|
||||
|
||||
def __init__(self, account: IcloudAccount, device: IcloudDevice) -> None:
|
||||
"""Initialize the battery sensor."""
|
||||
|
@ -102,11 +103,6 @@ class IcloudDeviceBatterySensor(SensorEntity):
|
|||
name=self._device.name,
|
||||
)
|
||||
|
||||
@property
|
||||
def should_poll(self) -> bool:
|
||||
"""No polling needed."""
|
||||
return False
|
||||
|
||||
async def async_added_to_hass(self):
|
||||
"""Register state update callback."""
|
||||
self._unsub_dispatcher = async_dispatcher_connect(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue