Use EntityCategory enum in Onewire (#60907)

* Use EntityCategory enum in Onewire

* Add checks for the entity_category

* Fix typo

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-03 18:20:00 +01:00 committed by GitHub
parent 0a2ca1f7d5
commit adf2fa5664
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 2 deletions

View file

@ -9,8 +9,9 @@ from typing import TYPE_CHECKING, Any
from homeassistant.components.onewire.model import OWServerDeviceDescription
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_TYPE, ENTITY_CATEGORY_CONFIG
from homeassistant.const import CONF_TYPE
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from .const import (
@ -62,7 +63,7 @@ DEVICE_SWITCHES: dict[str, tuple[OneWireEntityDescription, ...]] = {
OneWireSwitchEntityDescription(
key="IAD",
entity_registry_enabled_default=False,
entity_category=ENTITY_CATEGORY_CONFIG,
entity_category=EntityCategory.CONFIG,
name="IAD",
read_mode=READ_MODE_BOOL,
),