Disable uptime sensor by default in Unifi (#87484)
Disable Uptime sensor by default in Unifipull/87487/head
parent
1cd7f221d5
commit
d5b2062774
|
@ -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,
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue