From de89de890fd33e31e01760c8004ec2bdc6a9bae0 Mon Sep 17 00:00:00 2001 From: zyell Date: Sat, 12 Sep 2015 07:27:05 -0700 Subject: [PATCH] Move state constants to __init__ for all thermostats --- homeassistant/components/thermostat/__init__.py | 4 ++++ homeassistant/components/thermostat/nest.py | 7 ++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/thermostat/__init__.py b/homeassistant/components/thermostat/__init__.py index bb981d25572..940c656ad94 100644 --- a/homeassistant/components/thermostat/__init__.py +++ b/homeassistant/components/thermostat/__init__.py @@ -23,6 +23,10 @@ SCAN_INTERVAL = 60 SERVICE_SET_AWAY_MODE = "set_away_mode" SERVICE_SET_TEMPERATURE = "set_temperature" +STATE_HEAT = "heat" +STATE_COOL = "cool" +STATE_IDLE = "idle" + ATTR_CURRENT_TEMPERATURE = "current_temperature" ATTR_AWAY_MODE = "away_mode" ATTR_MAX_TEMP = "max_temp" diff --git a/homeassistant/components/thermostat/nest.py b/homeassistant/components/thermostat/nest.py index 9c4dbfaf937..c724a4f6dea 100644 --- a/homeassistant/components/thermostat/nest.py +++ b/homeassistant/components/thermostat/nest.py @@ -5,13 +5,10 @@ Adds support for Nest thermostats. """ import logging -from homeassistant.components.thermostat import ThermostatDevice +from homeassistant.components.thermostat import (ThermostatDevice, STATE_COOL, + STATE_IDLE, STATE_HEAT) from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD, TEMP_CELCIUS) -STATE_HEAT = "heat" -STATE_COOL = "cool" -STATE_IDLE = "idle" - REQUIREMENTS = ['python-nest==2.6.0']