From 17dd8ddc9a20e08067a8fa4ef364bbad25fe43c1 Mon Sep 17 00:00:00 2001 From: William Scanlon Date: Wed, 6 Jan 2016 12:22:50 -0500 Subject: [PATCH 01/22] Added wink power strip support --- homeassistant/components/switch/wink.py | 2 ++ homeassistant/components/wink.py | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/switch/wink.py b/homeassistant/components/switch/wink.py index e64245c430d..297777d3145 100644 --- a/homeassistant/components/switch/wink.py +++ b/homeassistant/components/switch/wink.py @@ -30,3 +30,5 @@ def setup_platform(hass, config, add_devices, discovery_info=None): pywink.set_bearer_token(token) add_devices(WinkToggleDevice(switch) for switch in pywink.get_switches()) + add_devices(WinkToggleDevice(switch) for switch in + pywink.get_powerstrip_outlets()) diff --git a/homeassistant/components/wink.py b/homeassistant/components/wink.py index 9f28183a149..bc8e83b291c 100644 --- a/homeassistant/components/wink.py +++ b/homeassistant/components/wink.py @@ -37,9 +37,10 @@ def setup(hass, config): # Load components for the devices in the Wink that we support for component_name, func_exists, discovery_type in ( ('light', pywink.get_bulbs, DISCOVER_LIGHTS), - ('switch', pywink.get_switches, DISCOVER_SWITCHES), - ('sensor', lambda: pywink.get_sensors or pywink.get_eggtrays, - DISCOVER_SENSORS), + ('switch', lambda: pywink.get_switches or + pywink.get_powerstrip_outlets, DISCOVER_SWITCHES), + ('sensor', lambda: pywink.get_sensors or + pywink.get_eggtrays, DISCOVER_SENSORS), ('lock', pywink.get_locks, DISCOVER_LOCKS)): if func_exists(): From 2803631906f968a9790f5b240489116c5f748aed Mon Sep 17 00:00:00 2001 From: William Scanlon Date: Fri, 8 Jan 2016 08:25:26 -0500 Subject: [PATCH 02/22] Updated python-wink to 0.4.0 --- homeassistant/components/light/wink.py | 2 +- homeassistant/components/lock/wink.py | 2 +- homeassistant/components/sensor/wink.py | 2 +- homeassistant/components/switch/wink.py | 5 ++--- homeassistant/components/wink.py | 2 +- requirements_all.txt | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/light/wink.py b/homeassistant/components/light/wink.py index 7b99b1882ae..b5066ca49f7 100644 --- a/homeassistant/components/light/wink.py +++ b/homeassistant/components/light/wink.py @@ -12,7 +12,7 @@ from homeassistant.components.light import ATTR_BRIGHTNESS from homeassistant.components.wink import WinkToggleDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['python-wink==0.3.1'] +REQUIREMENTS = ['python-wink==0.4.0'] def setup_platform(hass, config, add_devices_callback, discovery_info=None): diff --git a/homeassistant/components/lock/wink.py b/homeassistant/components/lock/wink.py index bbf4ef04f64..10324c4e46e 100644 --- a/homeassistant/components/lock/wink.py +++ b/homeassistant/components/lock/wink.py @@ -11,7 +11,7 @@ import logging from homeassistant.components.lock import LockDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['python-wink==0.3.1'] +REQUIREMENTS = ['python-wink==0.4.0'] def setup_platform(hass, config, add_devices, discovery_info=None): diff --git a/homeassistant/components/sensor/wink.py b/homeassistant/components/sensor/wink.py index c93e93b32de..77b53e5e9af 100644 --- a/homeassistant/components/sensor/wink.py +++ b/homeassistant/components/sensor/wink.py @@ -11,7 +11,7 @@ import logging from homeassistant.helpers.entity import Entity from homeassistant.const import CONF_ACCESS_TOKEN, STATE_OPEN, STATE_CLOSED -REQUIREMENTS = ['python-wink==0.3.1'] +REQUIREMENTS = ['python-wink==0.4.0'] def setup_platform(hass, config, add_devices, discovery_info=None): diff --git a/homeassistant/components/switch/wink.py b/homeassistant/components/switch/wink.py index 297777d3145..f8335fc3c54 100644 --- a/homeassistant/components/switch/wink.py +++ b/homeassistant/components/switch/wink.py @@ -11,7 +11,7 @@ import logging from homeassistant.components.wink import WinkToggleDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['python-wink==0.3.1'] +REQUIREMENTS = ['python-wink==0.4.0'] def setup_platform(hass, config, add_devices, discovery_info=None): @@ -30,5 +30,4 @@ def setup_platform(hass, config, add_devices, discovery_info=None): pywink.set_bearer_token(token) add_devices(WinkToggleDevice(switch) for switch in pywink.get_switches()) - add_devices(WinkToggleDevice(switch) for switch in - pywink.get_powerstrip_outlets()) + add_devices(WinkToggleDevice(switch) for switch in pywink.get_powerstrip_outlets()) diff --git a/homeassistant/components/wink.py b/homeassistant/components/wink.py index bc8e83b291c..996d5ebb44f 100644 --- a/homeassistant/components/wink.py +++ b/homeassistant/components/wink.py @@ -16,7 +16,7 @@ from homeassistant.const import ( ATTR_SERVICE, ATTR_DISCOVERED, ATTR_FRIENDLY_NAME) DOMAIN = "wink" -REQUIREMENTS = ['python-wink==0.3.1'] +REQUIREMENTS = ['python-wink==0.4.0'] DISCOVER_LIGHTS = "wink.lights" DISCOVER_SWITCHES = "wink.switches" diff --git a/requirements_all.txt b/requirements_all.txt index 5566e67fb9f..ef7ab2a67ae 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -66,7 +66,7 @@ pyvera==0.2.2 # homeassistant.components.lock.wink # homeassistant.components.sensor.wink # homeassistant.components.switch.wink -python-wink==0.3.1 +python-wink==0.4.0 # homeassistant.components.media_player.cast pychromecast==0.6.13 From d867366be135c1d31040ebdd6175ac48fd9716bc Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Tue, 12 Jan 2016 21:15:14 -0500 Subject: [PATCH 03/22] add proliphix thermostat support The proliphix nt10e is an early network thermostat that supports an HTTP interface. This adds basic support for it to home-assistant (get / set heating setback). --- .coveragerc | 1 + .../components/thermostat/proliphix.py | 88 +++++++++++++++++++ requirements_all.txt | 3 + 3 files changed, 92 insertions(+) create mode 100644 homeassistant/components/thermostat/proliphix.py diff --git a/.coveragerc b/.coveragerc index 272ace975c4..f37af10f295 100644 --- a/.coveragerc +++ b/.coveragerc @@ -121,6 +121,7 @@ omit = homeassistant/components/thermostat/homematic.py homeassistant/components/thermostat/honeywell.py homeassistant/components/thermostat/nest.py + homeassistant/components/thermostat/proliphix.py homeassistant/components/thermostat/radiotherm.py diff --git a/homeassistant/components/thermostat/proliphix.py b/homeassistant/components/thermostat/proliphix.py new file mode 100644 index 00000000000..d9e9dbabdeb --- /dev/null +++ b/homeassistant/components/thermostat/proliphix.py @@ -0,0 +1,88 @@ +"""homeassistant.components.thermostat.proliphix +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The Proliphix NT10e Thermostat is an ethernet connected thermostat. It +has a local HTTP interface that is based on get/set of OID values. A +complete collection of the API is available in this API doc: + +https://github.com/sdague/thermostat.rb/blob/master/docs/PDP_API_R1_11.pdf +""" + +from homeassistant.components.thermostat import (ThermostatDevice, STATE_COOL, + STATE_IDLE, STATE_HEAT) +from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, + CONF_HOST, TEMP_FAHRENHEIT) + +REQUIREMENTS = ['proliphix==0.1.0'] + + +def setup_platform(hass, config, add_devices, discovery_info=None): + """ Sets up the proliphix thermostats. """ + username = config.get(CONF_USERNAME) + password = config.get(CONF_PASSWORD) + host = config.get(CONF_HOST) + + import proliphix + + pdp = proliphix.PDP(host, username, password) + + add_devices([ + ProliphixThermostat(pdp) + ]) + + +class ProliphixThermostat(ThermostatDevice): + """ Represents a Proliphix thermostat. """ + + def __init__(self, pdp): + self._pdp = pdp + # initial data + self._pdp.update() + self._name = self._pdp.name + + @property + def should_poll(self): + return True + + def update(self): + self._pdp.update() + + @property + def name(self): + """ Returns the name. """ + return self._name + + @property + def device_state_attributes(self): + return { + "fan": self._pdp.fan_state + } + + @property + def unit_of_measurement(self): + """ Returns the unit of measurement. """ + return TEMP_FAHRENHEIT + + @property + def current_temperature(self): + """ Returns the current temperature. """ + return self._pdp.cur_temp + + @property + def target_temperature(self): + """ Returns the temperature we try to reach. """ + return self._pdp.setback_heat + + @property + def operation(self): + state = self._pdp.hvac_state + if state in (1, 2): + return STATE_IDLE + elif state == 3: + return STATE_HEAT + elif state == 6: + return STATE_COOL + + def set_temperature(self, temperature): + """ Set new target temperature. """ + self._pdp.setback_heat = temperature diff --git a/requirements_all.txt b/requirements_all.txt index 1bc00b4c46d..92350b3bd9e 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -190,6 +190,9 @@ evohomeclient==0.2.4 # homeassistant.components.thermostat.nest python-nest==2.6.0 +# homeassistant.components.thermostat.proliphix +proliphix==0.1.0 + # homeassistant.components.thermostat.radiotherm radiotherm==1.2 From de5bee635914ff781a35d3c109d3372a39303ee8 Mon Sep 17 00:00:00 2001 From: William Scanlon Date: Thu, 14 Jan 2016 08:56:59 -0500 Subject: [PATCH 04/22] Updated python-wink version --- homeassistant/components/light/wink.py | 2 +- homeassistant/components/lock/wink.py | 2 +- homeassistant/components/sensor/wink.py | 2 +- homeassistant/components/switch/wink.py | 5 +++-- homeassistant/components/wink.py | 2 +- requirements_all.txt | 2 +- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/light/wink.py b/homeassistant/components/light/wink.py index b5066ca49f7..294f092c050 100644 --- a/homeassistant/components/light/wink.py +++ b/homeassistant/components/light/wink.py @@ -12,7 +12,7 @@ from homeassistant.components.light import ATTR_BRIGHTNESS from homeassistant.components.wink import WinkToggleDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['python-wink==0.4.0'] +REQUIREMENTS = ['python-wink==0.4.1'] def setup_platform(hass, config, add_devices_callback, discovery_info=None): diff --git a/homeassistant/components/lock/wink.py b/homeassistant/components/lock/wink.py index 10324c4e46e..6c457c722f9 100644 --- a/homeassistant/components/lock/wink.py +++ b/homeassistant/components/lock/wink.py @@ -11,7 +11,7 @@ import logging from homeassistant.components.lock import LockDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['python-wink==0.4.0'] +REQUIREMENTS = ['python-wink==0.4.1'] def setup_platform(hass, config, add_devices, discovery_info=None): diff --git a/homeassistant/components/sensor/wink.py b/homeassistant/components/sensor/wink.py index 77b53e5e9af..8acc99f2d3d 100644 --- a/homeassistant/components/sensor/wink.py +++ b/homeassistant/components/sensor/wink.py @@ -11,7 +11,7 @@ import logging from homeassistant.helpers.entity import Entity from homeassistant.const import CONF_ACCESS_TOKEN, STATE_OPEN, STATE_CLOSED -REQUIREMENTS = ['python-wink==0.4.0'] +REQUIREMENTS = ['python-wink==0.4.1'] def setup_platform(hass, config, add_devices, discovery_info=None): diff --git a/homeassistant/components/switch/wink.py b/homeassistant/components/switch/wink.py index f8335fc3c54..e01065c3cd4 100644 --- a/homeassistant/components/switch/wink.py +++ b/homeassistant/components/switch/wink.py @@ -11,7 +11,7 @@ import logging from homeassistant.components.wink import WinkToggleDevice from homeassistant.const import CONF_ACCESS_TOKEN -REQUIREMENTS = ['python-wink==0.4.0'] +REQUIREMENTS = ['python-wink==0.4.1'] def setup_platform(hass, config, add_devices, discovery_info=None): @@ -30,4 +30,5 @@ def setup_platform(hass, config, add_devices, discovery_info=None): pywink.set_bearer_token(token) add_devices(WinkToggleDevice(switch) for switch in pywink.get_switches()) - add_devices(WinkToggleDevice(switch) for switch in pywink.get_powerstrip_outlets()) + add_devices(WinkToggleDevice(switch) for switch in + pywink.get_powerstrip_outlets()) diff --git a/homeassistant/components/wink.py b/homeassistant/components/wink.py index 996d5ebb44f..a719c5613a4 100644 --- a/homeassistant/components/wink.py +++ b/homeassistant/components/wink.py @@ -16,7 +16,7 @@ from homeassistant.const import ( ATTR_SERVICE, ATTR_DISCOVERED, ATTR_FRIENDLY_NAME) DOMAIN = "wink" -REQUIREMENTS = ['python-wink==0.4.0'] +REQUIREMENTS = ['python-wink==0.4.1'] DISCOVER_LIGHTS = "wink.lights" DISCOVER_SWITCHES = "wink.switches" diff --git a/requirements_all.txt b/requirements_all.txt index ef7ab2a67ae..0457fbb0266 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -66,7 +66,7 @@ pyvera==0.2.2 # homeassistant.components.lock.wink # homeassistant.components.sensor.wink # homeassistant.components.switch.wink -python-wink==0.4.0 +python-wink==0.4.1 # homeassistant.components.media_player.cast pychromecast==0.6.13 From 1dd99a6d5d896eb26233856b065ddcb930921363 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 14 Jan 2016 22:02:02 -0800 Subject: [PATCH 05/22] Update frontend --- homeassistant/components/frontend/version.py | 2 +- homeassistant/components/frontend/www_static/frontend.html | 1 + .../components/frontend/www_static/home-assistant-polymer | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/frontend/version.py b/homeassistant/components/frontend/version.py index bc2dc90bdf9..e0eaf447f0a 100644 --- a/homeassistant/components/frontend/version.py +++ b/homeassistant/components/frontend/version.py @@ -1,2 +1,2 @@ """ DO NOT MODIFY. Auto-generated by build_frontend script """ -VERSION = "fe71771b9b24b0fb72a56e775c3e1112" +VERSION = "ab1affef682040e0a7752b98b8ba7f52" diff --git a/homeassistant/components/frontend/www_static/frontend.html b/homeassistant/components/frontend/www_static/frontend.html index da7c887cda3..7cef9a04419 100644 --- a/homeassistant/components/frontend/www_static/frontend.html +++ b/homeassistant/components/frontend/www_static/frontend.html @@ -3607,6 +3607,7 @@ case"touchend":return this.addPointerListenerEnd(t,e,i,n);case"touchmove":return iron-image { border-radius: 50%; + background-color: #FFFFFF; } ha-state-icon { diff --git a/homeassistant/components/frontend/www_static/home-assistant-polymer b/homeassistant/components/frontend/www_static/home-assistant-polymer index 0b99a5933c3..2b7d4ead1e8 160000 --- a/homeassistant/components/frontend/www_static/home-assistant-polymer +++ b/homeassistant/components/frontend/www_static/home-assistant-polymer @@ -1 +1 @@ -Subproject commit 0b99a5933c35b88c3369e992426fff8bf450aa01 +Subproject commit 2b7d4ead1e8ab05d0df7a20d3fe7a76d5791f94b From 5ee17ffc585884224136539496d53ab84e3ee890 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 14 Jan 2016 23:47:55 -0800 Subject: [PATCH 06/22] Update frontend --- homeassistant/components/frontend/version.py | 2 +- homeassistant/components/frontend/www_static/frontend.html | 4 ++-- .../components/frontend/www_static/home-assistant-polymer | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/frontend/version.py b/homeassistant/components/frontend/version.py index e0eaf447f0a..b8a31e418ca 100644 --- a/homeassistant/components/frontend/version.py +++ b/homeassistant/components/frontend/version.py @@ -1,2 +1,2 @@ """ DO NOT MODIFY. Auto-generated by build_frontend script """ -VERSION = "ab1affef682040e0a7752b98b8ba7f52" +VERSION = "1003c31441ec44b3db84b49980f736a7" diff --git a/homeassistant/components/frontend/www_static/frontend.html b/homeassistant/components/frontend/www_static/frontend.html index 7cef9a04419..1816b922342 100644 --- a/homeassistant/components/frontend/www_static/frontend.html +++ b/homeassistant/components/frontend/www_static/frontend.html @@ -5103,7 +5103,7 @@ case"touchend":return this.addPointerListenerEnd(t,e,i,n);case"touchmove":return border-radius: 50%; }