From ba49cca8d04bc7cd4561914dc6abaf8ba14b81fa Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 8 Mar 2019 23:04:20 +0100 Subject: [PATCH] Fix for HA 0.89 --- custom_components/climate/e_thermostaat.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/custom_components/climate/e_thermostaat.py b/custom_components/climate/e_thermostaat.py index eeeaa84..dad1848 100644 --- a/custom_components/climate/e_thermostaat.py +++ b/custom_components/climate/e_thermostaat.py @@ -1,21 +1,24 @@ """ Adds support for the Essent Icy E-Thermostaat units. For more details about this platform, please refer to the documentation at -https://home-assistant.io/components/climate.e_thermostaat/ +https://github.com/custom-components/climate.e_thermostaat """ import logging import requests import voluptuous as vol -from homeassistant.components.climate import ( - ClimateDevice, PLATFORM_SCHEMA, SUPPORT_OPERATION_MODE, - SUPPORT_TARGET_TEMPERATURE, SUPPORT_AWAY_MODE) +from homeassistant.components.climate import ClimateDevice, PLATFORM_SCHEMA +try: + from homeassistant.components.climate.const import ( + SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE, SUPPORT_AWAY_MODE) +except ImportError: + from homeassistant.components.climate import ( + SUPPORT_OPERATION_MODE, SUPPORT_TARGET_TEMPERATURE, SUPPORT_AWAY_MODE) from homeassistant.const import ( - ATTR_TEMPERATURE, - CONF_USERNAME, CONF_PASSWORD, TEMP_CELSIUS) + ATTR_TEMPERATURE, CONF_USERNAME, CONF_PASSWORD, TEMP_CELSIUS) import homeassistant.helpers.config_validation as cv -__version__ = '0.2.0' +__version__ = '0.2.1' _LOGGER = logging.getLogger(__name__)