Change climate default limits to constants

Min and max temp and humidity are now defined in climate __init__.py
and are available for import in subclasses.
This commit is contained in:
Philip Rosenberg-Watt 2018-05-31 10:34:07 -06:00
parent 60f692c7bb
commit dae90abb34
5 changed files with 24 additions and 16 deletions

View file

@ -14,7 +14,8 @@ from homeassistant.core import DOMAIN as HA_DOMAIN
from homeassistant.components.climate import (
STATE_HEAT, STATE_COOL, STATE_IDLE, STATE_AUTO, ClimateDevice,
ATTR_OPERATION_MODE, ATTR_AWAY_MODE, SUPPORT_OPERATION_MODE,
SUPPORT_AWAY_MODE, SUPPORT_TARGET_TEMPERATURE, PLATFORM_SCHEMA)
SUPPORT_AWAY_MODE, SUPPORT_TARGET_TEMPERATURE, PLATFORM_SCHEMA,
DEFAULT_MIN_TEMP, DEFAULT_MAX_TEMP)
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT, STATE_ON, STATE_OFF, ATTR_TEMPERATURE,
CONF_NAME, ATTR_ENTITY_ID, SERVICE_TURN_ON, SERVICE_TURN_OFF,
@ -268,7 +269,7 @@ class GenericThermostat(ClimateDevice):
return self._min_temp
# get default temp from super class
return ClimateDevice.min_temp.fget(self)
return DEFAULT_MIN_TEMP
@property
def max_temp(self):
@ -278,7 +279,7 @@ class GenericThermostat(ClimateDevice):
return self._max_temp
# Get default temp from super class
return ClimateDevice.max_temp.fget(self)
return DEFAULT_MAX_TEMP
@asyncio.coroutine
def _async_sensor_changed(self, entity_id, old_state, new_state):