diff --git a/homeassistant/components/unifi/sensor.py b/homeassistant/components/unifi/sensor.py index a88b750fdf7..aec123ca273 100644 --- a/homeassistant/components/unifi/sensor.py +++ b/homeassistant/components/unifi/sensor.py @@ -154,6 +154,7 @@ ENTITY_DESCRIPTIONS: tuple[UnifiSensorEntityDescription, ...] = ( device_class=SensorDeviceClass.TIMESTAMP, entity_category=EntityCategory.DIAGNOSTIC, has_entity_name=True, + entity_registry_enabled_default=False, allowed_fn=lambda controller, _: controller.option_allow_uptime_sensors, api_handler_fn=lambda api: api.clients, available_fn=lambda controller, obj_id: controller.available, diff --git a/tests/components/unifi/test_sensor.py b/tests/components/unifi/test_sensor.py index 3aa4114e829..d3823c2fd9e 100644 --- a/tests/components/unifi/test_sensor.py +++ b/tests/components/unifi/test_sensor.py @@ -193,6 +193,7 @@ async def test_uptime_sensors( hass, aioclient_mock, mock_unifi_websocket, + entity_registry_enabled_by_default, initial_uptime, event_uptime, new_uptime, @@ -263,7 +264,9 @@ async def test_uptime_sensors( assert hass.states.get("sensor.client1_uptime") is None -async def test_remove_sensors(hass, aioclient_mock, mock_unifi_websocket): +async def test_remove_sensors( + hass, aioclient_mock, mock_unifi_websocket, entity_registry_enabled_by_default +): """Verify removing of clients work as expected.""" wired_client = { "hostname": "Wired client",