Use _attr_should_poll in components [o-r] (#77364)
This commit is contained in:
parent
4142530368
commit
d32f3e359f
18 changed files with 34 additions and 98 deletions
|
@ -56,6 +56,8 @@ SWITCHES_SCHEMA = vol.Schema(
|
|||
class PilightBaseDevice(RestoreEntity):
|
||||
"""Base class for pilight switches and lights."""
|
||||
|
||||
_attr_should_poll = False
|
||||
|
||||
def __init__(self, hass, name, config):
|
||||
"""Initialize a device."""
|
||||
self._hass = hass
|
||||
|
@ -95,11 +97,6 @@ class PilightBaseDevice(RestoreEntity):
|
|||
"""Get the name of the switch."""
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def should_poll(self):
|
||||
"""No polling needed, state set when correct code is received."""
|
||||
return False
|
||||
|
||||
@property
|
||||
def assumed_state(self):
|
||||
"""Return True if unable to access real state of the entity."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue