Disable generic unifiprotect object sensors by default (#120059)

This commit is contained in:
J. Nick Koston 2024-06-20 22:12:31 -05:00 committed by GitHub
parent 68462b014c
commit 4de8cca911
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -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",

View File

@ -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]