From 09ee03c406ea6cf429fac8f62152eb81ca895427 Mon Sep 17 00:00:00 2001 From: JimBoCA Date: Sat, 26 Dec 2020 15:34:15 -0800 Subject: [PATCH] Add note about #63 which will need to be fixed in the future, and only print error once --- nodes/Thermostat.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nodes/Thermostat.py b/nodes/Thermostat.py index f2271e5..65be16f 100644 --- a/nodes/Thermostat.py +++ b/nodes/Thermostat.py @@ -41,6 +41,7 @@ def __init__(self, controller, primary, address, thermostatId, name, revData, fu self.weather = None self.forcast = None self._gcde = {} + self._gcidx = {} # We track our driver values because we need the value before it's been pushed. self.driver = dict() super(Thermostat, self).__init__(controller, primary, address, name) @@ -280,8 +281,10 @@ def getClimateIndex(self,name): if name in climateMap: climateIndex = climateMap[name] else: - LOGGER.error("Unknown climateType='{}'".format(name)) - climateIndex = climateMap['unknown'] + if not name in self._gcidx[name]: + LOGGER.error("Unknown climateType='{}' which is a known issue https://github.com/Einstein42/udi-ecobee-poly/issues/63".format(name)) + self._gcidx[name] = True + climateIndex = climateMap['unknown'] return climateIndex def getCurrentClimateDict(self): @@ -295,7 +298,7 @@ def getClimateDict(self,name): # Only show the error one time. if not cref in self._gcde: self._gcde[cref] = True - LOGGER.error('{}:getClimateDict: Unknown climateRef name {} See: https://github.com/Einstein42/udi-ecobee-poly/issues/63'.format(self.address,name),exc_info=True) + LOGGER.error('{}:getClimateDict: Unknown climateRef name {}'.format(self.address,name),exc_info=True) return None def getSensorAddressOld(self,sdata):