diff --git a/homeassistant/components/unifiprotect/manifest.json b/homeassistant/components/unifiprotect/manifest.json index 5acec2299518..185675c3564f 100644 --- a/homeassistant/components/unifiprotect/manifest.json +++ b/homeassistant/components/unifiprotect/manifest.json @@ -9,5 +9,5 @@ "iot_class": "local_push", "loggers": ["uiprotect"], "quality_scale": "platinum", - "requirements": ["uiprotect==16.8.0"] + "requirements": ["uiprotect==16.12.0"] } diff --git a/homeassistant/components/unifiprotect/switch.py b/homeassistant/components/unifiprotect/switch.py index 0fc189d473c9..b8562bba66d4 100644 --- a/homeassistant/components/unifiprotect/switch.py +++ b/homeassistant/components/unifiprotect/switch.py @@ -100,9 +100,6 @@ CAMERA_SWITCHES: tuple[ProtectSwitchEntityDescription, ...] = ( key="high_fps", translation_key="high_fps", entity_category=EntityCategory.CONFIG, - # has_highfps has no public counterpart yet (uilibs/uiprotect#1201), so - # this stays unreachable in API-key-only mode even though the value - # and setter are migrated. ufp_required_field="feature_flags.has_highfps", ufp_public_value="is_high_fps_enabled", ufp_set_method_fn=_set_highfps, diff --git a/requirements_all.txt b/requirements_all.txt index 6fca6a30171d..af1357dd3acb 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -3347,7 +3347,7 @@ uasiren==0.0.1 uhooapi==1.2.8 # homeassistant.components.unifiprotect -uiprotect==16.8.0 +uiprotect==16.12.0 # homeassistant.components.landisgyr_heat_meter ultraheat-api==0.6.1 diff --git a/tests/components/unifiprotect/test_switch.py b/tests/components/unifiprotect/test_switch.py index 5cc9468e34ba..d2c69f75e8c0 100644 --- a/tests/components/unifiprotect/test_switch.py +++ b/tests/components/unifiprotect/test_switch.py @@ -1294,14 +1294,15 @@ async def test_switch_hybrid_public_sensor_without_private_deferred( @pytest.mark.parametrize( - ("fixture_name", "make", "key", "setter", "absent_keys"), + ("fixture_name", "make", "key", "setter", "present_keys", "absent_keys"), [ pytest.param( "doorbell", _make_streamless_public_camera, "smart_person", "set_person_detection", - {"ssh", "motion", "high_fps", "privacy_mode", "color_night_vision"}, + {"high_fps"}, + {"ssh", "motion", "privacy_mode", "color_night_vision"}, id="camera", ), pytest.param( @@ -1313,6 +1314,7 @@ async def test_switch_hybrid_public_sensor_without_private_deferred( ), "motion", "set_motion_status", + set(), {"status_light", "temperature"}, id="sensor", ), @@ -1321,6 +1323,7 @@ async def test_switch_hybrid_public_sensor_without_private_deferred( partial(make_public_light, is_indicator_enabled=True), "status_light", "set_status_light", + set(), {"ssh"}, id="light", ), @@ -1337,6 +1340,7 @@ async def test_public_only_switch_end_to_end( make: Callable[[Any], Mock], key: str, setter: str, + present_keys: set[str], absent_keys: set[str], ) -> None: """A public-only entry builds the migrated switches from the public object. @@ -1354,6 +1358,7 @@ async def test_public_only_switch_end_to_end( assert ufp_public_only.entry.state is ConfigEntryState.LOADED keys = _switch_keys(entity_registry, device.mac) assert key in keys + assert present_keys <= keys assert not keys & absent_keys assert hass.states.get("switch.unifiprotect_insights_enabled") is None diff --git a/tests/components/unifiprotect/utils.py b/tests/components/unifiprotect/utils.py index 1983926a7fa6..0760e8f2c5c6 100644 --- a/tests/components/unifiprotect/utils.py +++ b/tests/components/unifiprotect/utils.py @@ -679,7 +679,7 @@ def make_public_camera( ) flags = camera.feature_flags public.has_package_camera = flags.has_package_camera - # Spec'd so a private-only flag (e.g. ``has_highfps``) reads as absent. + # Spec'd so a private-only flag reads as absent. public.feature_flags = Mock(spec=PublicCameraFeatureFlags) public.feature_flags.support_full_hd_snapshot = flags.support_full_hd_snapshot public.feature_flags.has_hdr = flags.has_hdr @@ -691,6 +691,10 @@ def make_public_camera( public.feature_flags.smart_detect_audio_types = list( flags.smart_detect_audio_types or [] ) + # Derived from the mirrored video modes with the library's own logic. + public.feature_flags.has_highfps = PublicCameraFeatureFlags.has_highfps.fget( + public.feature_flags + ) # The capability gate runs the library's own logic on the mirrored flags. public.can_detect = Mock(side_effect=partial(PublicCamera.can_detect, public)) qualities = [ChannelQuality.HIGH, ChannelQuality.MEDIUM, ChannelQuality.LOW]