mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Bump mozart-api to 3.4.1.8.5 (#113745)
This commit is contained in:
parent
cc9eab4c78
commit
0ed48c844d
@ -4,7 +4,11 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
||||||
from aiohttp.client_exceptions import ClientConnectorError
|
from aiohttp.client_exceptions import (
|
||||||
|
ClientConnectorError,
|
||||||
|
ClientOSError,
|
||||||
|
ServerTimeoutError,
|
||||||
|
)
|
||||||
from mozart_api.exceptions import ApiException
|
from mozart_api.exceptions import ApiException
|
||||||
from mozart_api.mozart_client import MozartClient
|
from mozart_api.mozart_client import MozartClient
|
||||||
|
|
||||||
@ -44,12 +48,18 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
model=entry.data[CONF_MODEL],
|
model=entry.data[CONF_MODEL],
|
||||||
)
|
)
|
||||||
|
|
||||||
client = MozartClient(host=entry.data[CONF_HOST], websocket_reconnect=True)
|
client = MozartClient(host=entry.data[CONF_HOST])
|
||||||
|
|
||||||
# Check connection and try to initialize it.
|
# Check API and WebSocket connection
|
||||||
try:
|
try:
|
||||||
await client.get_battery_state(_request_timeout=3)
|
await client.check_device_connection(True)
|
||||||
except (ApiException, ClientConnectorError, TimeoutError) as error:
|
except* (
|
||||||
|
ClientConnectorError,
|
||||||
|
ClientOSError,
|
||||||
|
ServerTimeoutError,
|
||||||
|
ApiException,
|
||||||
|
TimeoutError,
|
||||||
|
) as error:
|
||||||
await client.close_api_client()
|
await client.close_api_client()
|
||||||
raise ConfigEntryNotReady(f"Unable to connect to {entry.title}") from error
|
raise ConfigEntryNotReady(f"Unable to connect to {entry.title}") from error
|
||||||
|
|
||||||
@ -61,11 +71,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
client,
|
client,
|
||||||
)
|
)
|
||||||
|
|
||||||
# Check and start WebSocket connection
|
# Start WebSocket connection
|
||||||
if not await client.connect_notifications(remote_control=True):
|
await client.connect_notifications(remote_control=True, reconnect=True)
|
||||||
raise ConfigEntryNotReady(
|
|
||||||
f"Unable to connect to {entry.title} WebSocket notification channel"
|
|
||||||
)
|
|
||||||
|
|
||||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||||
|
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/bang_olufsen",
|
"documentation": "https://www.home-assistant.io/integrations/bang_olufsen",
|
||||||
"integration_type": "device",
|
"integration_type": "device",
|
||||||
"iot_class": "local_push",
|
"iot_class": "local_push",
|
||||||
"requirements": ["mozart-api==3.2.1.150.6"],
|
"requirements": ["mozart-api==3.4.1.8.5"],
|
||||||
"zeroconf": ["_bangolufsen._tcp.local."]
|
"zeroconf": ["_bangolufsen._tcp.local."]
|
||||||
}
|
}
|
||||||
|
@ -363,7 +363,9 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity):
|
|||||||
def is_volume_muted(self) -> bool | None:
|
def is_volume_muted(self) -> bool | None:
|
||||||
"""Boolean if volume is currently muted."""
|
"""Boolean if volume is currently muted."""
|
||||||
if self._volume.muted and self._volume.muted.muted:
|
if self._volume.muted and self._volume.muted.muted:
|
||||||
return self._volume.muted.muted
|
# The any return here is side effect of pydantic v2 compatibility
|
||||||
|
# This will be fixed in the future.
|
||||||
|
return self._volume.muted.muted # type: ignore[no-any-return]
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@ -1332,7 +1332,7 @@ motionblindsble==0.0.9
|
|||||||
motioneye-client==0.3.14
|
motioneye-client==0.3.14
|
||||||
|
|
||||||
# homeassistant.components.bang_olufsen
|
# homeassistant.components.bang_olufsen
|
||||||
mozart-api==3.2.1.150.6
|
mozart-api==3.4.1.8.5
|
||||||
|
|
||||||
# homeassistant.components.mullvad
|
# homeassistant.components.mullvad
|
||||||
mullvad-api==1.0.0
|
mullvad-api==1.0.0
|
||||||
|
@ -1074,7 +1074,7 @@ motionblindsble==0.0.9
|
|||||||
motioneye-client==0.3.14
|
motioneye-client==0.3.14
|
||||||
|
|
||||||
# homeassistant.components.bang_olufsen
|
# homeassistant.components.bang_olufsen
|
||||||
mozart-api==3.2.1.150.6
|
mozart-api==3.4.1.8.5
|
||||||
|
|
||||||
# homeassistant.components.mullvad
|
# homeassistant.components.mullvad
|
||||||
mullvad-api==1.0.0
|
mullvad-api==1.0.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user