Fixed variable scoping

pull/56/head
jamespcole 2015-03-09 15:16:02 +11:00
parent 56622596e7
commit 06c3087310
2 changed files with 4 additions and 6 deletions

View File

@ -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)

View File

@ -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):