Drop use of deprecated ENTITY_CATEGORIES (#64607)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2022-01-24 13:36:42 +01:00 committed by GitHub
parent 6ed60d2b32
commit 3a09090a4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 14 deletions

View file

@ -25,7 +25,6 @@ from homeassistant.const import (
CONF_ENTITY_ID,
CONF_NAME,
CONF_PORT,
ENTITY_CATEGORIES,
)
from homeassistant.core import HomeAssistant, callback, split_entity_id
from homeassistant.helpers import device_registry, entity_registry
@ -542,7 +541,7 @@ class OptionsFlowHandler(config_entries.OptionsFlow):
entity_cat_entities = set()
for entity_id in all_supported_entities:
if ent_reg_ent := ent_reg.async_get(entity_id):
if ent_reg_ent.entity_category in ENTITY_CATEGORIES:
if ent_reg_ent.entity_category is not None:
entity_cat_entities.add(entity_id)
# Remove entity category entities since we will exclude them anyways
all_supported_entities = {