From 4de8cca9117c31fd7fed3684e9a691a26b39cca7 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 20 Jun 2024 22:12:31 -0500 Subject: [PATCH] Disable generic unifiprotect object sensors by default (#120059) --- homeassistant/components/unifiprotect/binary_sensor.py | 2 ++ tests/components/unifiprotect/test_binary_sensor.py | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/unifiprotect/binary_sensor.py b/homeassistant/components/unifiprotect/binary_sensor.py index 9bda0e8f310..966354749bc 100644 --- a/homeassistant/components/unifiprotect/binary_sensor.py +++ b/homeassistant/components/unifiprotect/binary_sensor.py @@ -446,6 +446,7 @@ SMART_EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = ( icon="mdi:eye", ufp_required_field="feature_flags.has_smart_detect", ufp_event_obj="last_smart_detect_event", + entity_registry_enabled_default=False, ), ProtectBinaryEventEntityDescription( key="smart_obj_person", @@ -490,6 +491,7 @@ SMART_EVENT_SENSORS: tuple[ProtectBinaryEventEntityDescription, ...] = ( icon="mdi:eye", ufp_required_field="feature_flags.has_smart_detect", ufp_event_obj="last_smart_audio_detect_event", + entity_registry_enabled_default=False, ), ProtectBinaryEventEntityDescription( key="smart_audio_smoke", diff --git a/tests/components/unifiprotect/test_binary_sensor.py b/tests/components/unifiprotect/test_binary_sensor.py index 51fb882144f..42782d10429 100644 --- a/tests/components/unifiprotect/test_binary_sensor.py +++ b/tests/components/unifiprotect/test_binary_sensor.py @@ -65,11 +65,11 @@ async def test_binary_sensor_camera_remove( ufp.api.bootstrap.nvr.system_info.ustorage = None await init_entry(hass, ufp, [doorbell, unadopted_camera]) - assert_entity_counts(hass, Platform.BINARY_SENSOR, 9, 8) + assert_entity_counts(hass, Platform.BINARY_SENSOR, 9, 6) await remove_entities(hass, ufp, [doorbell, unadopted_camera]) assert_entity_counts(hass, Platform.BINARY_SENSOR, 0, 0) await adopt_devices(hass, ufp, [doorbell, unadopted_camera]) - assert_entity_counts(hass, Platform.BINARY_SENSOR, 9, 8) + assert_entity_counts(hass, Platform.BINARY_SENSOR, 9, 6) async def test_binary_sensor_light_remove( @@ -137,7 +137,7 @@ async def test_binary_sensor_setup_camera_all( ufp.api.bootstrap.nvr.system_info.ustorage = None await init_entry(hass, ufp, [doorbell, unadopted_camera]) - assert_entity_counts(hass, Platform.BINARY_SENSOR, 9, 8) + assert_entity_counts(hass, Platform.BINARY_SENSOR, 9, 6) description = EVENT_SENSORS[0] unique_id, entity_id = ids_from_device_description( @@ -287,7 +287,7 @@ async def test_binary_sensor_update_motion( """Test binary_sensor motion entity.""" await init_entry(hass, ufp, [doorbell, unadopted_camera]) - assert_entity_counts(hass, Platform.BINARY_SENSOR, 15, 14) + assert_entity_counts(hass, Platform.BINARY_SENSOR, 15, 12) _, entity_id = ids_from_device_description( Platform.BINARY_SENSOR, doorbell, EVENT_SENSORS[1]