Handle Uncaught exceptions in async_update Honeywell (#90746)
parent
03e9cb233f
commit
3d426e1e2b
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue