Use DeviceClass Enums in devolo_home_control tests (#62116)

This commit is contained in:
Dave T 2021-12-16 22:27:44 +00:00 committed by GitHub
parent b7ece5ae00
commit 61f2f9d9ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,14 +4,10 @@ from unittest.mock import patch
import pytest
from homeassistant.components.binary_sensor import DOMAIN
from homeassistant.const import (
ENTITY_CATEGORY_DIAGNOSTIC,
STATE_OFF,
STATE_ON,
STATE_UNAVAILABLE,
)
from homeassistant.const import STATE_OFF, STATE_ON, STATE_UNAVAILABLE
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry
from homeassistant.helpers.entity import EntityCategory
from . import configure_integration
from .mocks import (
@ -42,9 +38,7 @@ async def test_binary_sensor(hass: HomeAssistant):
state = hass.states.get(f"{DOMAIN}.test_2")
assert state is not None
er = entity_registry.async_get(hass)
assert (
er.async_get(f"{DOMAIN}.test_2").entity_category == ENTITY_CATEGORY_DIAGNOSTIC
)
assert er.async_get(f"{DOMAIN}.test_2").entity_category == EntityCategory.DIAGNOSTIC
# Emulate websocket message: sensor turned on
test_gateway.publisher.dispatch("Test", ("Test", True))