Refactor entity_category str types (#62790)

This commit is contained in:
Dave T 2021-12-27 17:23:08 +00:00 committed by GitHub
parent 377b0efc60
commit 8fd60dbd51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 10 deletions

View file

@ -33,6 +33,7 @@ from homeassistant.helpers.entity import (
ENTITY_CATEGORIES_SCHEMA,
DeviceInfo,
Entity,
EntityCategory,
async_generate_entity_id,
)
from homeassistant.helpers.typing import ConfigType
@ -695,7 +696,7 @@ class MqttEntity(
return self._config[CONF_ENABLED_BY_DEFAULT]
@property
def entity_category(self) -> str | None:
def entity_category(self) -> EntityCategory | str | None:
"""Return the entity category if any."""
return self._config.get(CONF_ENTITY_CATEGORY)