Use _attr_should_poll in components [j-n] (#77357)

This commit is contained in:
epenet 2022-08-26 21:19:37 +02:00 committed by GitHub
parent b36321988f
commit dff9baf880
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 41 additions and 114 deletions

View file

@ -87,6 +87,8 @@ def setup_platform(
class NX584ZoneSensor(BinarySensorEntity):
"""Representation of a NX584 zone as a sensor."""
_attr_should_poll = False
def __init__(self, zone, zone_type):
"""Initialize the nx594 binary sensor."""
self._zone = zone
@ -97,11 +99,6 @@ class NX584ZoneSensor(BinarySensorEntity):
"""Return the class of this sensor, from DEVICE_CLASSES."""
return self._zone_type
@property
def should_poll(self):
"""No polling needed."""
return False
@property
def name(self):
"""Return the name of the binary sensor."""