Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump ZHA dependencies #118658

Merged
merged 3 commits into from
Jun 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion homeassistant/components/zha/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ async def async_pre_backup(hass: HomeAssistant) -> None:
"""Perform operations before a backup starts."""
_LOGGER.debug("Performing coordinator backup")

zha_gateway = get_zha_gateway(hass)
try:
zha_gateway = get_zha_gateway(hass)
except ValueError:
# If ZHA config is in `configuration.yaml` and ZHA is not set up, do nothing
_LOGGER.warning("No ZHA gateway exists, skipping coordinator backup")
return

await zha_gateway.application_controller.backups.create_backup(load_devices=True)


Expand Down
4 changes: 2 additions & 2 deletions homeassistant/components/zha/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"universal_silabs_flasher"
],
"requirements": [
"bellows==0.38.4",
"bellows==0.39.0",
"pyserial==3.5",
"zha-quirks==0.0.116",
"zigpy-deconz==0.23.1",
"zigpy==0.64.0",
"zigpy-xbee==0.20.1",
"zigpy-zigate==0.12.0",
"zigpy-znp==0.12.1",
"universal-silabs-flasher==0.0.18",
"universal-silabs-flasher==0.0.20",
"pyserial-asyncio-fast==0.11"
],
"usb": [
Expand Down
4 changes: 2 additions & 2 deletions requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ beautifulsoup4==4.12.3
# beewi-smartclim==0.0.10

# homeassistant.components.zha
bellows==0.38.4
bellows==0.39.0

# homeassistant.components.bmw_connected_drive
bimmer-connected[china]==0.15.3
Expand Down Expand Up @@ -2794,7 +2794,7 @@ unifi_ap==0.0.1
unifiled==0.11

# homeassistant.components.zha
universal-silabs-flasher==0.0.18
universal-silabs-flasher==0.0.20

# homeassistant.components.upb
upb-lib==0.5.6
Expand Down
4 changes: 2 additions & 2 deletions requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ base36==0.1.1
beautifulsoup4==4.12.3

# homeassistant.components.zha
bellows==0.38.4
bellows==0.39.0

# homeassistant.components.bmw_connected_drive
bimmer-connected[china]==0.15.3
Expand Down Expand Up @@ -2162,7 +2162,7 @@ ultraheat-api==0.5.7
unifi-discovery==1.1.8

# homeassistant.components.zha
universal-silabs-flasher==0.0.18
universal-silabs-flasher==0.0.20

# homeassistant.components.upb
upb-lib==0.5.6
Expand Down
9 changes: 8 additions & 1 deletion tests/components/zha/test_backup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Unit tests for ZHA backup platform."""

from unittest.mock import AsyncMock
from unittest.mock import AsyncMock, patch

from zigpy.application import ControllerApplication

Expand All @@ -22,6 +22,13 @@ async def test_pre_backup(
)


@patch("homeassistant.components.zha.backup.get_zha_gateway", side_effect=ValueError())
async def test_pre_backup_no_gateway(hass: HomeAssistant, setup_zha) -> None:
"""Test graceful backup failure when no gateway exists."""
await setup_zha()
await async_pre_backup(hass)


async def test_post_backup(hass: HomeAssistant, setup_zha) -> None:
"""Test no-op `async_post_backup`."""
await setup_zha()
Expand Down