From 3d426e1e2b87fffcd9d02125957c1b8e12405081 Mon Sep 17 00:00:00 2001 From: mkmer Date: Thu, 6 Apr 2023 04:44:13 -0400 Subject: [PATCH] Handle Uncaught exceptions in async_update Honeywell (#90746) --- homeassistant/components/honeywell/climate.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/honeywell/climate.py b/homeassistant/components/honeywell/climate.py index e9dae1e2074..bde70e6bb0c 100644 --- a/homeassistant/components/honeywell/climate.py +++ b/homeassistant/components/honeywell/climate.py @@ -1,9 +1,11 @@ """Support for Honeywell (US) Total Connect Comfort climate systems.""" from __future__ import annotations +import asyncio import datetime from typing import Any +from aiohttp import ClientConnectionError import aiosomecomfort from homeassistant.components.climate import ( @@ -421,10 +423,7 @@ class HoneywellUSThermostat(ClimateEntity): try: await self._device.refresh() self._attr_available = True - except ( - aiosomecomfort.SomeComfortError, - OSError, - ): + except aiosomecomfort.SomeComfortError: try: await self._data.client.login() @@ -433,5 +432,12 @@ class HoneywellUSThermostat(ClimateEntity): await self.hass.async_create_task( self.hass.config_entries.async_reload(self._data.entry_id) ) - except aiosomecomfort.SomeComfortError: + except ( + aiosomecomfort.SomeComfortError, + ClientConnectionError, + asyncio.TimeoutError, + ): self._attr_available = False + + except (ClientConnectionError, asyncio.TimeoutError): + self._attr_available = False