Remove unnecessary should poll from switch classes (#41218)

This commit is contained in:
springstan authored and GitHub committed 2020-10-04 21:31:02 +02:00
1 parent f17089e46e
commit e51be33e18
7 files changed
-35

No files matched your search

@@ -66,11 +66,6 @@ class PwrCtrlSwitch(SwitchEntity):
self._port = port
self._parent_device = parent_device
@property
def should_poll(self):
"""Return the polling state."""
return True
@property
def unique_id(self):
"""Return the unique ID of the device."""
@@ -95,11 +95,6 @@ class DINRelay(SwitchEntity):
"""Return true if relay is on."""
return self._state
@property
def should_poll(self):
"""Return the polling state."""
return True
def turn_on(self, **kwargs):
"""Instruct the relay to turn on."""
self._outlet.on()
@@ -68,11 +68,6 @@ class HikvisionMotionSwitch(SwitchEntity):
self._hikvision_cam = hikvision_cam
self._state = STATE_OFF
@property
def should_poll(self):
"""Poll for status regularly."""
return True
@property
def name(self):
"""Return the name of the device if any."""
@@ -94,11 +94,6 @@ class KankunSwitch(SwitchEntity):
except requests.RequestException:
_LOGGER.error("State query failed")
@property
def should_poll(self):
"""Return the polling state."""
return True
@property
def name(self):
"""Return the name of the switch."""
-5
View File
@@ -69,11 +69,6 @@ class MfiSwitch(SwitchEntity):
self._port = port
self._target_state = None
@property
def should_poll(self):
"""Return the polling state."""
return True
@property
def unique_id(self):
"""Return the unique ID of the device."""
@@ -73,11 +73,6 @@ class S20Switch(SwitchEntity):
self._state = False
self._exc = S20Exception
@property
def should_poll(self):
"""Return the polling state."""
return True
@property
def name(self):
"""Return the name of the switch."""
@@ -235,11 +235,6 @@ class XiaomiPlugGenericSwitch(SwitchEntity):
self._device_features = FEATURE_FLAGS_GENERIC
self._skip_update = False
@property
def should_poll(self):
"""Poll the plug."""
return True
@property
def unique_id(self):
"""Return an unique ID."""