Add entity category to UniFi sensors and switches (#58484)
This commit is contained in:
parent
dd1154ad08
commit
47f6313e5b
4 changed files with 33 additions and 1 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue