Add Entity categories for Home Assistant (#2636)

This commit is contained in:
Jesse Hills authored and GitHub committed 2021-11-08 07:24:52 +13:00
1 parent b450d4c734
commit 3c0414c420
45 files changed
+354 -14

No files matched your search

+3
View File
@@ -2,6 +2,7 @@ import logging
from esphome.const import (
CONF_DISABLED_BY_DEFAULT,
CONF_ENTITY_CATEGORY,
CONF_ICON,
CONF_INTERNAL,
CONF_NAME,
@@ -102,6 +103,8 @@ async def setup_entity(var, config):
add(var.set_internal(config[CONF_INTERNAL]))
if CONF_ICON in config:
add(var.set_icon(config[CONF_ICON]))
if CONF_ENTITY_CATEGORY in config:
add(var.set_entity_category(config[CONF_ENTITY_CATEGORY]))
def extract_registry_entry_config(registry, full_config):