Use _attr_should_poll in components [o-r] (#77364)

This commit is contained in:
epenet 2022-08-26 21:41:41 +02:00 committed by GitHub
parent 4142530368
commit d32f3e359f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 34 additions and 98 deletions

View file

@ -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."""