From f78bf0ace6c6622fd1e7c030f49dba4158fffef7 Mon Sep 17 00:00:00 2001 From: Michael Wood Date: Thu, 26 Mar 2020 16:23:11 -0500 Subject: [PATCH] Fix for Keyerror 'mode' issue --- custom_components/infinitive/climate.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/infinitive/climate.py b/custom_components/infinitive/climate.py index 619750b..1217025 100644 --- a/custom_components/infinitive/climate.py +++ b/custom_components/infinitive/climate.py @@ -254,7 +254,9 @@ def hvac_action(self): def update(self): """Update current status from infinitive device.""" _LOGGER.debug("Updating Infinitive status") - self._status = self._inf_device.get_status() + status = self._inf_device.get_status() + if 'mode' in status.keys(): + self._status = status try: self._hvac_mode = self._status['mode'] self._target_temperature_high = self._status['coolSetpoint']