From 06c30873109b754e125108151e24ea6efecbe327 Mon Sep 17 00:00:00 2001 From: jamespcole Date: Mon, 9 Mar 2015 15:16:02 +1100 Subject: [PATCH] Fixed variable scoping --- homeassistant/components/sensor/vera.py | 3 +-- homeassistant/components/switch/vera.py | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/sensor/vera.py b/homeassistant/components/sensor/vera.py index 71531253207..9ec0b272856 100644 --- a/homeassistant/components/sensor/vera.py +++ b/homeassistant/components/sensor/vera.py @@ -101,8 +101,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None): class VeraSensor(Device): """ Represents a Vera Sensor """ - extra_data = None - current_value = '' def __init__(self, vera_device, extra_data=None): self.vera_device = vera_device @@ -111,6 +109,7 @@ class VeraSensor(Device): self._name = self.extra_data.get('name') else: self._name = self.vera_device.name + self.current_value = '' def __str__(self): return "%s %s %s" % (self.name, self.vera_device.deviceId, self.state) diff --git a/homeassistant/components/switch/vera.py b/homeassistant/components/switch/vera.py index 800913e6850..e302e707a72 100644 --- a/homeassistant/components/switch/vera.py +++ b/homeassistant/components/switch/vera.py @@ -102,10 +102,6 @@ def setup_platform(hass, config, add_devices, discovery_info=None): class VeraSwitch(ToggleDevice): """ Represents a Vera Switch """ - is_on_status = False - # for debouncing status check after command is sent - last_command_send = 0 - extra_data = None def __init__(self, vera_device, extra_data=None): self.vera_device = vera_device @@ -114,6 +110,9 @@ class VeraSwitch(ToggleDevice): self._name = self.extra_data.get('name') else: self._name = self.vera_device.name + self.is_on_status = False + # for debouncing status check after command is sent + self.last_command_send = 0 @property def name(self):