From 031d5ce2553120b23f38019d66f919469cc9c4d3 Mon Sep 17 00:00:00 2001 From: pavoni Date: Tue, 27 Oct 2015 23:43:06 +0000 Subject: [PATCH] Fix style issues, update pyvera version. --- homeassistant/components/light/vera.py | 16 +++++++++------- homeassistant/components/switch/vera.py | 6 +++--- requirements_all.txt | 2 +- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/homeassistant/components/light/vera.py b/homeassistant/components/light/vera.py index 21df4485527..2e9e02ebbe5 100644 --- a/homeassistant/components/light/vera.py +++ b/homeassistant/components/light/vera.py @@ -12,11 +12,11 @@ import time from requests.exceptions import RequestException from homeassistant.components.switch.vera import VeraSwitch -from homeassistant.components.light import Light, ATTR_BRIGHTNESS +from homeassistant.components.light import ATTR_BRIGHTNESS -REQUIREMENTS = ['https://github.com/balloob/home-assistant-vera-api/archive/' - 'a8f823066ead6c7da6fb5e7abaf16fef62e63364.zip' - '#python-vera==0.1'] +REQUIREMENTS = ['https://github.com/pavoni/home-assistant-vera-api/archive/' + '90e203b58c5897930a9567252943b7c96c39652b.zip' + '#python-vera==0.1.1'] _LOGGER = logging.getLogger(__name__) @@ -39,7 +39,10 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): controller = veraApi.VeraController(base_url) devices = [] try: - devices = controller.get_devices(['Switch', 'On/Off Switch', 'Dimmable Switch']) + devices = controller.get_devices([ + 'Switch', + 'On/Off Switch', + 'Dimmable Switch']) except RequestException: # There was a network related error connecting to the vera controller _LOGGER.exception("Error communicating with Vera API") @@ -55,6 +58,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): add_devices_callback(lights) + class VeraLight(VeraSwitch): """ Represents a Vera Light, including dimmable. """ @@ -67,7 +71,6 @@ class VeraLight(VeraSwitch): return attr - def turn_on(self, **kwargs): if ATTR_BRIGHTNESS in kwargs and self.vera_device.is_dimmable: self.vera_device.set_brightness(kwargs[ATTR_BRIGHTNESS]) @@ -76,4 +79,3 @@ class VeraLight(VeraSwitch): self.last_command_send = time.time() self.is_on_status = True - diff --git a/homeassistant/components/switch/vera.py b/homeassistant/components/switch/vera.py index ecf922e8cfa..55e519d8616 100644 --- a/homeassistant/components/switch/vera.py +++ b/homeassistant/components/switch/vera.py @@ -15,9 +15,9 @@ from homeassistant.helpers.entity import ToggleEntity from homeassistant.const import ( ATTR_BATTERY_LEVEL, ATTR_TRIPPED, ATTR_ARMED, ATTR_LAST_TRIP_TIME) -REQUIREMENTS = ['https://github.com/balloob/home-assistant-vera-api/archive/' - 'a8f823066ead6c7da6fb5e7abaf16fef62e63364.zip' - '#python-vera==0.1'] +REQUIREMENTS = ['https://github.com/pavoni/home-assistant-vera-api/archive/' + '90e203b58c5897930a9567252943b7c96c39652b.zip' + '#python-vera==0.1.1'] _LOGGER = logging.getLogger(__name__) diff --git a/requirements_all.txt b/requirements_all.txt index 11d91043d12..d04ea496cea 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -128,7 +128,7 @@ pyfttt==0.3 https://github.com/balloob/home-assistant-nzb-clients/archive/616cad59154092599278661af17e2a9f2cf5e2a9.zip#python-sabnzbd==0.1 # Vera (*.vera) -https://github.com/balloob/home-assistant-vera-api/archive/a8f823066ead6c7da6fb5e7abaf16fef62e63364.zip#python-vera==0.1 +https://github.com/pavoni/home-assistant-vera-api/archive/90e203b58c5897930a9567252943b7c96c39652b.zip#python-vera==0.1.1 # Sonos (media_player.sonos) SoCo==0.11.1