Use _attr_should_poll in components [h-i] (#77270)

This commit is contained in:
epenet 2022-08-26 10:20:38 +02:00 committed by GitHub
parent a46c25d2c8
commit 2a8109304f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 38 additions and 120 deletions

View file

@ -199,6 +199,8 @@ class HikvisionData:
class HikvisionBinarySensor(BinarySensorEntity):
"""Representation of a Hikvision binary sensor."""
_attr_should_poll = False
def __init__(self, hass, sensor, channel, cam, delay):
"""Initialize the binary_sensor."""
self._hass = hass
@ -255,11 +257,6 @@ class HikvisionBinarySensor(BinarySensorEntity):
# Sensor must be unknown to us, add as generic
return None
@property
def should_poll(self):
"""No polling needed."""
return False
@property
def extra_state_attributes(self):
"""Return the state attributes."""