mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Disable uptime sensor by default in Unifi (#87484)
Disable Uptime sensor by default in Unifi
This commit is contained in:
parent
1cd7f221d5
commit
d5b2062774
@ -154,6 +154,7 @@ ENTITY_DESCRIPTIONS: tuple[UnifiSensorEntityDescription, ...] = (
|
|||||||
device_class=SensorDeviceClass.TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
has_entity_name=True,
|
has_entity_name=True,
|
||||||
|
entity_registry_enabled_default=False,
|
||||||
allowed_fn=lambda controller, _: controller.option_allow_uptime_sensors,
|
allowed_fn=lambda controller, _: controller.option_allow_uptime_sensors,
|
||||||
api_handler_fn=lambda api: api.clients,
|
api_handler_fn=lambda api: api.clients,
|
||||||
available_fn=lambda controller, obj_id: controller.available,
|
available_fn=lambda controller, obj_id: controller.available,
|
||||||
|
@ -193,6 +193,7 @@ async def test_uptime_sensors(
|
|||||||
hass,
|
hass,
|
||||||
aioclient_mock,
|
aioclient_mock,
|
||||||
mock_unifi_websocket,
|
mock_unifi_websocket,
|
||||||
|
entity_registry_enabled_by_default,
|
||||||
initial_uptime,
|
initial_uptime,
|
||||||
event_uptime,
|
event_uptime,
|
||||||
new_uptime,
|
new_uptime,
|
||||||
@ -263,7 +264,9 @@ async def test_uptime_sensors(
|
|||||||
assert hass.states.get("sensor.client1_uptime") is None
|
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."""
|
"""Verify removing of clients work as expected."""
|
||||||
wired_client = {
|
wired_client = {
|
||||||
"hostname": "Wired client",
|
"hostname": "Wired client",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user