mirror of
https://github.com/home-assistant/core.git
synced 2025-08-10 16:15:08 +02:00
Fix Beosound Level not reconnecting properly
This commit is contained in:
@@ -5,6 +5,7 @@ import logging
|
|||||||
from multiprocessing.pool import ApplyResult
|
from multiprocessing.pool import ApplyResult
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|
||||||
|
from mozart_api.exceptions import ServiceException
|
||||||
from mozart_api.models import BatteryState
|
from mozart_api.models import BatteryState
|
||||||
from mozart_api.mozart_client import MozartClient
|
from mozart_api.mozart_client import MozartClient
|
||||||
from urllib3.exceptions import MaxRetryError
|
from urllib3.exceptions import MaxRetryError
|
||||||
@@ -62,7 +63,7 @@ async def init_entities(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
ApplyResult[BatteryState],
|
ApplyResult[BatteryState],
|
||||||
client.get_battery_state(async_req=True, _request_timeout=3),
|
client.get_battery_state(async_req=True, _request_timeout=3),
|
||||||
).get()
|
).get()
|
||||||
except MaxRetryError:
|
except (MaxRetryError, ServiceException):
|
||||||
_LOGGER.error("Unable to connect to %s", entry.data[CONF_NAME])
|
_LOGGER.error("Unable to connect to %s", entry.data[CONF_NAME])
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user