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

@ -81,6 +81,8 @@ def setup_platform(
class NumatoGpioBinarySensor(BinarySensorEntity):
"""Represents a binary sensor (input) port of a Numato GPIO expander."""
_attr_should_poll = False
def __init__(self, name, device_id, port, invert_logic, api):
"""Initialize the Numato GPIO based binary sensor object."""
self._name = name or DEVICE_DEFAULT_NAME
@ -106,11 +108,6 @@ class NumatoGpioBinarySensor(BinarySensorEntity):
self._state = level
self.async_write_ha_state()
@property
def should_poll(self):
"""No polling needed."""
return False
@property
def name(self):
"""Return the name of the sensor."""