Add entity category to UniFi sensors and switches (#58484)

This commit is contained in:
Robert Svensson 2021-10-26 20:23:20 +02:00 committed by GitHub
parent dd1154ad08
commit 47f6313e5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 33 additions and 1 deletions

View file

@ -16,6 +16,7 @@ from homeassistant.components.unifi.const import (
DOMAIN as UNIFI_DOMAIN,
)
from homeassistant.components.unifi.switch import POE_SWITCH
from homeassistant.const import ENTITY_CATEGORY_CONFIG
from homeassistant.helpers import entity_registry as er
from homeassistant.helpers.dispatcher import async_dispatcher_send
@ -373,6 +374,14 @@ async def test_switches(hass, aioclient_mock):
assert dpi_switch.state == "on"
assert dpi_switch.attributes["icon"] == "mdi:network"
ent_reg = er.async_get(hass)
for entry_id in (
"switch.poe_client_1",
"switch.block_client_1",
"switch.block_media_streaming",
):
assert ent_reg.async_get(entry_id).entity_category == ENTITY_CATEGORY_CONFIG
# Block and unblock client
aioclient_mock.post(