mirror of
https://github.com/home-assistant/core.git
synced 2025-08-14 01:55:18 +02:00
Use enums in unifi tests (#62151)
This commit is contained in:
@@ -15,9 +15,9 @@ from homeassistant.components.unifi.const import (
|
||||
CONF_TRACK_DEVICES,
|
||||
DOMAIN as UNIFI_DOMAIN,
|
||||
)
|
||||
from homeassistant.const import ENTITY_CATEGORY_DIAGNOSTIC
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
from .test_controller import setup_unifi_integration
|
||||
@@ -79,7 +79,7 @@ async def test_bandwidth_sensors(hass, aioclient_mock, mock_unifi_websocket):
|
||||
ent_reg = er.async_get(hass)
|
||||
assert (
|
||||
ent_reg.async_get("sensor.wired_client_rx").entity_category
|
||||
== ENTITY_CATEGORY_DIAGNOSTIC
|
||||
is EntityCategory.DIAGNOSTIC
|
||||
)
|
||||
|
||||
# Verify state update
|
||||
@@ -190,7 +190,7 @@ async def test_uptime_sensors(
|
||||
ent_reg = er.async_get(hass)
|
||||
assert (
|
||||
ent_reg.async_get("sensor.client1_uptime").entity_category
|
||||
== ENTITY_CATEGORY_DIAGNOSTIC
|
||||
is EntityCategory.DIAGNOSTIC
|
||||
)
|
||||
|
||||
# Verify normal new event doesn't change uptime
|
||||
|
@@ -16,9 +16,10 @@ 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, STATE_OFF, STATE_ON
|
||||
from homeassistant.const import STATE_OFF, STATE_ON
|
||||
from homeassistant.helpers import entity_registry as er
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||
from homeassistant.helpers.entity import EntityCategory
|
||||
|
||||
from .test_controller import (
|
||||
CONTROLLER_HOST,
|
||||
@@ -408,7 +409,7 @@ async def test_switches(hass, aioclient_mock):
|
||||
"switch.block_client_1",
|
||||
"switch.block_media_streaming",
|
||||
):
|
||||
assert ent_reg.async_get(entry_id).entity_category == ENTITY_CATEGORY_CONFIG
|
||||
assert ent_reg.async_get(entry_id).entity_category is EntityCategory.CONFIG
|
||||
|
||||
# Block and unblock client
|
||||
|
||||
|
Reference in New Issue
Block a user