From 7566a38f017a4cf1c19d1476033af2121b125908 Mon Sep 17 00:00:00 2001 From: MajestyIV Date: Mon, 23 Sep 2019 14:39:10 +0200 Subject: [PATCH] HM-CC-TC was not recognized (#26623) * HM-CC-TC was not recognized * guard instead of exception --- homeassistant/components/homematic/climate.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/homematic/climate.py b/homeassistant/components/homematic/climate.py index 1a2f642f91c..935ebb9b497 100644 --- a/homeassistant/components/homematic/climate.py +++ b/homeassistant/components/homematic/climate.py @@ -94,7 +94,9 @@ class HMThermostat(HMDevice, ClimateDevice): if self._data.get("BOOST_MODE", False): return "boost" - # Get the name of the mode + if not self._hm_control_mode: + return None + mode = HM_ATTRIBUTE_SUPPORT[HM_CONTROL_MODE][1][self._hm_control_mode] mode = mode.lower() @@ -177,8 +179,9 @@ class HMThermostat(HMDevice, ClimateDevice): """Return Control mode.""" if HMIP_CONTROL_MODE in self._data: return self._data[HMIP_CONTROL_MODE] + # Homematic - return self._data["CONTROL_MODE"] + return self._data.get("CONTROL_MODE") def _init_data_struct(self): """Generate a data dict (self._data) from the Homematic metadata."""