From e51be33e18dc9724955a8fa472eed21060097c75 Mon Sep 17 00:00:00 2001 From: springstan <46536646+springstan@users.noreply.github.com> Date: Sun, 4 Oct 2020 21:31:02 +0200 Subject: [PATCH] Remove unnecessary should poll from switch classes (#41218) --- homeassistant/components/anel_pwrctrl/switch.py | 5 ----- homeassistant/components/digitalloggers/switch.py | 5 ----- homeassistant/components/hikvisioncam/switch.py | 5 ----- homeassistant/components/kankun/switch.py | 5 ----- homeassistant/components/mfi/switch.py | 5 ----- homeassistant/components/orvibo/switch.py | 5 ----- homeassistant/components/xiaomi_miio/switch.py | 5 ----- 7 files changed, 35 deletions(-) diff --git a/homeassistant/components/anel_pwrctrl/switch.py b/homeassistant/components/anel_pwrctrl/switch.py index c769f51d5b6b..0669a3bb6c6a 100644 --- a/homeassistant/components/anel_pwrctrl/switch.py +++ b/homeassistant/components/anel_pwrctrl/switch.py @@ -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.""" diff --git a/homeassistant/components/digitalloggers/switch.py b/homeassistant/components/digitalloggers/switch.py index 7448b9fbcf38..f86f6d7f1aa5 100644 --- a/homeassistant/components/digitalloggers/switch.py +++ b/homeassistant/components/digitalloggers/switch.py @@ -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() diff --git a/homeassistant/components/hikvisioncam/switch.py b/homeassistant/components/hikvisioncam/switch.py index 2e924135bd40..2f1f89cd2615 100644 --- a/homeassistant/components/hikvisioncam/switch.py +++ b/homeassistant/components/hikvisioncam/switch.py @@ -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.""" diff --git a/homeassistant/components/kankun/switch.py b/homeassistant/components/kankun/switch.py index ce179515e880..d1a616f86fa8 100644 --- a/homeassistant/components/kankun/switch.py +++ b/homeassistant/components/kankun/switch.py @@ -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.""" diff --git a/homeassistant/components/mfi/switch.py b/homeassistant/components/mfi/switch.py index d2ba2371303b..3dfbf3fb594c 100644 --- a/homeassistant/components/mfi/switch.py +++ b/homeassistant/components/mfi/switch.py @@ -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.""" diff --git a/homeassistant/components/orvibo/switch.py b/homeassistant/components/orvibo/switch.py index fec30cdade7b..a03d9fc5ff0d 100644 --- a/homeassistant/components/orvibo/switch.py +++ b/homeassistant/components/orvibo/switch.py @@ -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.""" diff --git a/homeassistant/components/xiaomi_miio/switch.py b/homeassistant/components/xiaomi_miio/switch.py index 6dfcc539a44b..e406e344ebf6 100644 --- a/homeassistant/components/xiaomi_miio/switch.py +++ b/homeassistant/components/xiaomi_miio/switch.py @@ -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."""