Updated vera switch and sensor to the new architecture

This commit is contained in:
jamespcole committed 2015-03-07 12:59:13 +11:00
1 parent ba58c080e3
commit fceac45ddd
2 files changed
+5 -19

No files matched your search

+2 -9
View File
@@ -51,9 +51,8 @@ def get_extra_device_data(device_data, device_id):
return None
def get_switches():
return vera_switches
def setup_platform(hass, config, add_devices, discovery_info=None):
add_devices(get_devices(hass, config))
class VeraSwitch(ToggleDevice):
""" Represents a Vera Switch """
@@ -66,12 +65,6 @@ class VeraSwitch(ToggleDevice):
self.vera_device = vera_device
self.extra_data = extra_data
@property
def unique_id(self):
""" Returns the id of this switch """
return "{}.{}".format(
self.__class__, self.info.get('uniqueid', self.name))
@property
def name(self):
""" Get the mame of the switch. """