From 894ceacd40ea06eb2107dadf28f11c81cfd9d61d Mon Sep 17 00:00:00 2001 From: Nolan Gilley Date: Thu, 12 May 2016 01:03:21 -0400 Subject: [PATCH] Add Ecobee notify platform (#2021) * add send_message to ecobee via service call * farcy fixes * fix pydocstyle * ecobee notify component --- homeassistant/components/ecobee.py | 2 +- homeassistant/components/notify/ecobee.py | 31 +++++++++++++++++++++++ requirements_all.txt | 2 +- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 homeassistant/components/notify/ecobee.py diff --git a/homeassistant/components/ecobee.py b/homeassistant/components/ecobee.py index 21dd73ea6e6..11c49fd44eb 100644 --- a/homeassistant/components/ecobee.py +++ b/homeassistant/components/ecobee.py @@ -22,7 +22,7 @@ HOLD_TEMP = 'hold_temp' REQUIREMENTS = [ 'https://github.com/nkgilley/python-ecobee-api/archive/' - '92a2f330cbaf601d0618456fdd97e5a8c42c1c47.zip#python-ecobee==0.0.4'] + '4a884bc146a93991b4210f868f3d6aecf0a181e6.zip#python-ecobee==0.0.5'] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/notify/ecobee.py b/homeassistant/components/notify/ecobee.py new file mode 100644 index 00000000000..861d5439e4c --- /dev/null +++ b/homeassistant/components/notify/ecobee.py @@ -0,0 +1,31 @@ +""" +Support for ecobee Send Message service. + +For more details about this platform, please refer to the documentation at +https://home-assistant.io/components/notify.ecobee/ +""" +import logging +from homeassistant.components import ecobee +from homeassistant.components.notify import BaseNotificationService + +DEPENDENCIES = ['ecobee'] +_LOGGER = logging.getLogger(__name__) + + +def get_service(hass, config): + """Get the Ecobee notification service.""" + index = int(config['index']) if 'index' in config else 0 + return EcobeeNotificationService(index) + + +# pylint: disable=too-few-public-methods +class EcobeeNotificationService(BaseNotificationService): + """Implement the notification service for the Ecobee thermostat.""" + + def __init__(self, thermostat_index): + """Initialize the service.""" + self.thermostat_index = thermostat_index + + def send_message(self, message="", **kwargs): + """Send a message to a command line.""" + ecobee.NETWORK.ecobee.send_message(self.thermostat_index, message) diff --git a/requirements_all.txt b/requirements_all.txt index ddfc5a0802f..5331fd414e3 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -110,7 +110,7 @@ https://github.com/danieljkemp/onkyo-eiscp/archive/python3.zip#onkyo-eiscp==0.9. https://github.com/jamespcole/home-assistant-nzb-clients/archive/616cad59154092599278661af17e2a9f2cf5e2a9.zip#python-sabnzbd==0.1 # homeassistant.components.ecobee -https://github.com/nkgilley/python-ecobee-api/archive/92a2f330cbaf601d0618456fdd97e5a8c42c1c47.zip#python-ecobee==0.0.4 +https://github.com/nkgilley/python-ecobee-api/archive/4a884bc146a93991b4210f868f3d6aecf0a181e6.zip#python-ecobee==0.0.5 # homeassistant.components.switch.edimax https://github.com/rkabadi/pyedimax/archive/365301ce3ff26129a7910c501ead09ea625f3700.zip#pyedimax==0.1