From f4db5493949e23d3985123069e72058cbddb4dbc Mon Sep 17 00:00:00 2001 From: kingy444 Date: Mon, 27 Jul 2026 21:45:44 +1000 Subject: [PATCH] Bump aiopvapi to 3.4.0 (#177369) --- .../hunterdouglas_powerview/manifest.json | 2 +- .../hunterdouglas_powerview/scene.py | 5 +- requirements_all.txt | 2 +- .../hunterdouglas_powerview/conftest.py | 19 + .../fixtures/gen1/scenemembers.json | 551 ++++++++++++++++++ .../fixtures/gen1/scenes.json | 36 +- .../fixtures/scenes.json | 25 - 7 files changed, 594 insertions(+), 46 deletions(-) create mode 100644 tests/components/hunterdouglas_powerview/fixtures/gen1/scenemembers.json delete mode 100644 tests/components/hunterdouglas_powerview/fixtures/scenes.json diff --git a/homeassistant/components/hunterdouglas_powerview/manifest.json b/homeassistant/components/hunterdouglas_powerview/manifest.json index bf85be1bb583..d494e701d055 100644 --- a/homeassistant/components/hunterdouglas_powerview/manifest.json +++ b/homeassistant/components/hunterdouglas_powerview/manifest.json @@ -19,6 +19,6 @@ "integration_type": "hub", "iot_class": "local_polling", "loggers": ["aiopvapi"], - "requirements": ["aiopvapi==3.3.0"], + "requirements": ["aiopvapi==3.4.0"], "zeroconf": ["_powerview._tcp.local.", "_PowerView-G3._tcp.local."] } diff --git a/homeassistant/components/hunterdouglas_powerview/scene.py b/homeassistant/components/hunterdouglas_powerview/scene.py index 61c7516bfb29..90b8e9a9ca1b 100644 --- a/homeassistant/components/hunterdouglas_powerview/scene.py +++ b/homeassistant/components/hunterdouglas_powerview/scene.py @@ -29,7 +29,10 @@ async def async_setup_entry( pv_entry = entry.runtime_data pvscenes: list[PowerViewScene] = [] for scene in pv_entry.scene_data.values(): - room_name = getattr(pv_entry.room_data.get(scene.room_id), ATTR_NAME, "") + room_name = ", ".join( + getattr(pv_entry.room_data.get(room_id), ATTR_NAME, "") + for room_id in scene.room_id + ) pvscenes.append( PowerViewScene(pv_entry.coordinator, pv_entry.device_info, room_name, scene) ) diff --git a/requirements_all.txt b/requirements_all.txt index ba1c55a7c983..be9f33bc6998 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -387,7 +387,7 @@ aiopulse==0.4.7 aiopurpleair==2025.08.1 # homeassistant.components.hunterdouglas_powerview -aiopvapi==3.3.0 +aiopvapi==3.4.0 # homeassistant.components.lidarr # homeassistant.components.radarr diff --git a/tests/components/hunterdouglas_powerview/conftest.py b/tests/components/hunterdouglas_powerview/conftest.py index ea40ba4ecc61..4c9e45844956 100644 --- a/tests/components/hunterdouglas_powerview/conftest.py +++ b/tests/components/hunterdouglas_powerview/conftest.py @@ -28,6 +28,7 @@ def mock_hunterdouglas_hub( firmware_json: str, rooms_json: str, scenes_json: str, + scenemembers_json: str, shades_json: str, ) -> Generator[None]: """Return a mocked Powerview Hub with all data populated.""" @@ -64,6 +65,10 @@ def mock_hunterdouglas_hub( new_callable=PropertyMock, return_value=ShadePosition(primary=0, secondary=0, tilt=0, velocity=0), ), + patch( + "aiopvapi.scenes.SceneMembers.get_resources", + return_value=load_json_value_fixture(scenemembers_json, DOMAIN), + ), ): yield @@ -133,6 +138,20 @@ def scenes_json(api_version: int) -> str: raise ValueError(f"Unsupported api_version: {api_version}") +@pytest.fixture +def scenemembers_json(api_version: int) -> str: + """Return the get_resources fixture for a specific device.""" + if api_version == 1: + return "gen1/scenemembers.json" + if api_version == 2: + return "gen2/scenemembers.json" + if api_version == 3: + # gen3 does not have scenemembers endpoint + return "gen3/home/scenes.json" + # Add more conditions for different api_versions if needed + raise ValueError(f"Unsupported api_version: {api_version}") + + @pytest.fixture def shades_json(api_version: int) -> str: """Return the get_resources fixture for a specific device.""" diff --git a/tests/components/hunterdouglas_powerview/fixtures/gen1/scenemembers.json b/tests/components/hunterdouglas_powerview/fixtures/gen1/scenemembers.json new file mode 100644 index 000000000000..9ef2cce995cb --- /dev/null +++ b/tests/components/hunterdouglas_powerview/fixtures/gen1/scenemembers.json @@ -0,0 +1,551 @@ +{ + "sceneMemberIds": [ + 64407, 13542, 43466, 881, 51360, 27003, 32733, 58908, 41516, 52855, 2125, + 18781, 2697, 59661, 58301, 38062, 46934, 60041, 56318, 42923, 19317, 62337, + 17806, 64046, 61754, 35188, 57585, 44607, 5621, 64848, 5692, 41162, 56783, + 38058, 46346, 6358, 61891, 12137, 45552, 57019, 20718, 43661, 58875, 53326, + 61328, 400, 45652, 52292, 19246, 30009 + ], + "sceneMemberData": [ + { + "positions": { + "posKind1": 1, + "position1": 65535 + }, + "id": 64407, + "sceneId": 61648, + "shadeId": 26355, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 65535 + }, + "id": 13542, + "sceneId": 14067, + "shadeId": 49988, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0, + "posKind2": 2, + "position2": 0 + }, + "id": 43466, + "sceneId": 24626, + "shadeId": 40836, + "type": 0 + }, + { + "positions": { + "position1": 0, + "posKind1": 1 + }, + "id": 881, + "sceneId": 28856, + "shadeId": 37688, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 40, + "posKind2": 2, + "position2": 9679 + }, + "id": 51360, + "sceneId": 61648, + "shadeId": 17062, + "type": 0 + }, + { + "positions": { + "position1": 0, + "posKind1": 1 + }, + "id": 27003, + "sceneId": 48043, + "shadeId": 49988, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0 + }, + "id": 32733, + "sceneId": 36482, + "shadeId": 65396, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 65535 + }, + "id": 58908, + "sceneId": 61648, + "shadeId": 13542, + "type": 0 + }, + { + "positions": { + "position1": 0, + "posKind1": 1 + }, + "id": 41516, + "sceneId": 48043, + "shadeId": 37688, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 65535 + }, + "id": 52855, + "sceneId": 61648, + "shadeId": 49988, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0 + }, + "id": 2125, + "sceneId": 36482, + "shadeId": 13542, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0 + }, + "id": 18781, + "sceneId": 44767, + "shadeId": 26355, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0, + "posKind2": 2, + "position2": 30334 + }, + "id": 2697, + "sceneId": 959, + "shadeId": 40836, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0 + }, + "id": 59661, + "sceneId": 48756, + "shadeId": 13542, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0 + }, + "id": 58301, + "sceneId": 24626, + "shadeId": 26355, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 27 + }, + "id": 38062, + "sceneId": 24626, + "shadeId": 49988, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 40, + "posKind2": 2, + "position2": 0 + }, + "id": 46934, + "sceneId": 24626, + "shadeId": 13028, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0 + }, + "id": 60041, + "sceneId": 48043, + "shadeId": 26355, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0, + "posKind2": 2, + "position2": 0 + }, + "id": 56318, + "sceneId": 24626, + "shadeId": 5359, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 16 + }, + "id": 42923, + "sceneId": 24626, + "shadeId": 13542, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0, + "posKind2": 2, + "position2": 0 + }, + "id": 19317, + "sceneId": 59103, + "shadeId": 40836, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 180, + "posKind2": 2, + "position2": 6300 + }, + "id": 62337, + "sceneId": 19525, + "shadeId": 13028, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0, + "posKind2": 2, + "position2": 44624 + }, + "id": 17806, + "sceneId": 61648, + "shadeId": 40836, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0, + "posKind2": 2, + "position2": 0 + }, + "id": 64046, + "sceneId": 49070, + "shadeId": 5359, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 160 + }, + "id": 61754, + "sceneId": 25458, + "shadeId": 49988, + "type": 0 + }, + { + "positions": { + "position1": 65535, + "posKind1": 1 + }, + "id": 35188, + "sceneId": 61648, + "shadeId": 40458, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 65535 + }, + "id": 57585, + "sceneId": 61648, + "shadeId": 65396, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0 + }, + "id": 44607, + "sceneId": 64679, + "shadeId": 40458, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 65535 + }, + "id": 5621, + "sceneId": 59188, + "shadeId": 37688, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0, + "posKind2": 2, + "position2": 0 + }, + "id": 64848, + "sceneId": 61648, + "shadeId": 5359, + "type": 0 + }, + { + "positions": { + "position1": 0, + "posKind1": 1, + "posKind2": 2, + "position2": 46745 + }, + "id": 5692, + "sceneId": 61648, + "shadeId": 49782, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 65535 + }, + "id": 41162, + "sceneId": 61648, + "shadeId": 37688, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0 + }, + "id": 56783, + "sceneId": 6789, + "shadeId": 37688, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 47, + "posKind2": 2, + "position2": 9570 + }, + "id": 38058, + "sceneId": 22498, + "shadeId": 17062, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0 + }, + "id": 46346, + "sceneId": 24626, + "shadeId": 40458, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0, + "posKind2": 2, + "position2": 0 + }, + "id": 6358, + "sceneId": 3455, + "shadeId": 49782, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 23 + }, + "id": 61891, + "sceneId": 24626, + "shadeId": 65396, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 67 + }, + "id": 12137, + "sceneId": 24626, + "shadeId": 37688, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0, + "posKind2": 2, + "position2": 0 + }, + "id": 45552, + "sceneId": 3455, + "shadeId": 13028, + "type": 0 + }, + { + "positions": { + "position1": 65535, + "posKind1": 1 + }, + "id": 57019, + "sceneId": 59188, + "shadeId": 26355, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0, + "posKind2": 2, + "position2": 0 + }, + "id": 20718, + "sceneId": 24626, + "shadeId": 49782, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 65535 + }, + "id": 43661, + "sceneId": 59188, + "shadeId": 49988, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0 + }, + "id": 58875, + "sceneId": 48756, + "shadeId": 65396, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0 + }, + "id": 53326, + "sceneId": 51159, + "shadeId": 40458, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0, + "posKind2": 2, + "position2": 480 + }, + "id": 61328, + "sceneId": 24626, + "shadeId": 17062, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 0, + "posKind2": 2, + "position2": 480 + }, + "id": 400, + "sceneId": 49070, + "shadeId": 17062, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 8, + "posKind2": 2, + "position2": 6361 + }, + "id": 45652, + "sceneId": 19525, + "shadeId": 49782, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 16, + "posKind2": 2, + "position2": 47522 + }, + "id": 52292, + "sceneId": 61648, + "shadeId": 13028, + "type": 0 + }, + { + "positions": { + "posKind1": 1, + "position1": 64138 + }, + "id": 19246, + "sceneId": 59968, + "shadeId": 26355, + "type": 0 + }, + { + "positions": { + "posKind2": 2, + "position1": 0, + "position2": 0, + "posKind1": 1 + }, + "id": 30009, + "sceneId": 22498, + "shadeId": 5359, + "type": 0 + } + ] +} diff --git a/tests/components/hunterdouglas_powerview/fixtures/gen1/scenes.json b/tests/components/hunterdouglas_powerview/fixtures/gen1/scenes.json index 4b6b7fb9cc36..e0220ab4d113 100644 --- a/tests/components/hunterdouglas_powerview/fixtures/gen1/scenes.json +++ b/tests/components/hunterdouglas_powerview/fixtures/gen1/scenes.json @@ -8,7 +8,7 @@ "id": 19831, "networkNumber": 0, "name": "Q2xvc2UgTG91bmdlIFJvb20=", - "roomId": 4896, + "roomId": 58286, "order": 0, "colorId": 7, "iconId": 171, @@ -18,7 +18,7 @@ "id": 4068, "networkNumber": 1, "name": "Q2xvc2UgQmVkIDQ=", - "roomId": 4896, + "roomId": 24002, "order": 1, "colorId": 7, "iconId": 10, @@ -28,7 +28,7 @@ "id": 55363, "networkNumber": 2, "name": "Q2xvc2UgQmVkIDI=", - "roomId": 4896, + "roomId": 61856, "order": 2, "colorId": 11, "iconId": 171, @@ -38,7 +38,7 @@ "id": 43508, "networkNumber": 3, "name": "Q2xvc2UgTWFzdGVyIEJlZA==", - "roomId": 4896, + "roomId": 2030, "order": 3, "colorId": 11, "iconId": 10, @@ -48,7 +48,7 @@ "id": 59372, "networkNumber": 4, "name": "Q2xvc2UgRmFtaWx5", - "roomId": 4896, + "roomId": 34274, "order": 4, "colorId": 0, "iconId": 171, @@ -58,7 +58,7 @@ "id": 48243, "networkNumber": 5, "name": "T3BlbiBCZWQgNA==", - "roomId": 4896, + "roomId": 24002, "order": 5, "colorId": 0, "iconId": 10, @@ -68,7 +68,7 @@ "id": 54636, "networkNumber": 6, "name": "T3BlbiBNYXN0ZXIgQmVk", - "roomId": 4896, + "roomId": 2030, "order": 6, "colorId": 0, "iconId": 26, @@ -78,7 +78,7 @@ "id": 20625, "networkNumber": 7, "name": "T3BlbiBCZWQgMw==", - "roomId": 4896, + "roomId": 46225, "order": 7, "colorId": 7, "iconId": 26, @@ -88,7 +88,7 @@ "id": 4034, "networkNumber": 8, "name": "T3BlbiBGYW1pbHk=", - "roomId": 4896, + "roomId": 34274, "order": 8, "colorId": 11, "iconId": 26, @@ -98,7 +98,7 @@ "id": 59103, "networkNumber": 9, "name": "Q2xvc2UgU3R1ZHk=", - "roomId": 4896, + "roomId": 3304, "order": 9, "colorId": 0, "iconId": 171, @@ -108,7 +108,7 @@ "id": 61648, "networkNumber": 10, "name": "T3BlbiBBbGw=", - "roomId": 4896, + "roomId": 23884, "order": 10, "colorId": 11, "iconId": 26, @@ -118,7 +118,7 @@ "id": 24626, "networkNumber": 11, "name": "Q2xvc2UgQWxs", - "roomId": 4896, + "roomId": 23884, "order": 11, "colorId": 0, "iconId": 171, @@ -128,7 +128,7 @@ "id": 64679, "networkNumber": 12, "name": "T3BlbiBLaXRjaGVu", - "roomId": 4896, + "roomId": 9910, "order": 12, "colorId": 7, "iconId": 26, @@ -138,7 +138,7 @@ "id": 22498, "networkNumber": 13, "name": "T3BlbiBMb3VuZ2UgUm9vbQ==", - "roomId": 4896, + "roomId": 58286, "order": 13, "colorId": 7, "iconId": 26, @@ -148,7 +148,7 @@ "id": 25458, "networkNumber": 14, "name": "T3BlbiBCZWQgMg==", - "roomId": 4896, + "roomId": 61856, "order": 14, "colorId": 0, "iconId": 26, @@ -158,7 +158,7 @@ "id": 46225, "networkNumber": 15, "name": "Q2xvc2UgQmVkIDM=", - "roomId": 4896, + "roomId": 46225, "order": 15, "colorId": 0, "iconId": 26, @@ -168,7 +168,7 @@ "id": 51159, "networkNumber": 16, "name": "Q2xvc2UgS2l0Y2hlbg==", - "roomId": 4896, + "roomId": 9910, "order": 16, "colorId": 0, "iconId": 26, @@ -178,7 +178,7 @@ "id": 959, "networkNumber": 17, "name": "T3BlbiBTdHVkeQ==", - "roomId": 4896, + "roomId": 3304, "order": 17, "colorId": 0, "iconId": 26, diff --git a/tests/components/hunterdouglas_powerview/fixtures/scenes.json b/tests/components/hunterdouglas_powerview/fixtures/scenes.json deleted file mode 100644 index 7a9f7d9e8ebd..000000000000 --- a/tests/components/hunterdouglas_powerview/fixtures/scenes.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "sceneIds": [46274, 21015], - "sceneData": [ - { - "roomId": 12538, - "name": "one", - "colorId": 12, - "iconId": 0, - "networkNumber": 250, - "id": 46274, - "order": 0, - "hkAssist": false - }, - { - "roomId": 12538, - "name": "two", - "colorId": 14, - "iconId": 0, - "networkNumber": 231, - "id": 21015, - "order": 1, - "hkAssist": false - } - ] -}