Disable uptime sensor by default in Unifi (#87484)

Disable Uptime sensor by default in Unifi
pull/87487/head
Robert Hillis 2023-02-05 13:28:28 -05:00 committed by GitHub
parent 1cd7f221d5
commit d5b2062774
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

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

View File

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