From 201c9fed773e0ad0a137ca67597af0685c85d1b1 Mon Sep 17 00:00:00 2001 From: Tom Harris <tharris@harrisnj.net> Date: Sat, 14 Jul 2018 05:04:00 -0400 Subject: [PATCH] Implement is_on (#15459) * Implement is_on * Remove var --- homeassistant/components/switch/insteon_plm.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/switch/insteon_plm.py b/homeassistant/components/switch/insteon_plm.py index 42b4829f64e..c357d1ccc04 100644 --- a/homeassistant/components/switch/insteon_plm.py +++ b/homeassistant/components/switch/insteon_plm.py @@ -46,8 +46,7 @@ class InsteonPLMSwitchDevice(InsteonPLMEntity, SwitchDevice): @property def is_on(self): """Return the boolean response if the node is on.""" - onlevel = self._insteon_device_state.value - return bool(onlevel) + return bool(self._insteon_device_state.value) @asyncio.coroutine def async_turn_on(self, **kwargs): @@ -63,6 +62,11 @@ class InsteonPLMSwitchDevice(InsteonPLMEntity, SwitchDevice): class InsteonPLMOpenClosedDevice(InsteonPLMEntity, SwitchDevice): """A Class for an Insteon device.""" + @property + def is_on(self): + """Return the boolean response if the node is on.""" + return bool(self._insteon_device_state.value) + @asyncio.coroutine def async_turn_on(self, **kwargs): """Turn device on.""" -- GitLab