Use _attr_should_poll in components [j-n] (#77357)
This commit is contained in:
parent
b36321988f
commit
dff9baf880
23 changed files with 41 additions and 114 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue