1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-04 04:12:23 +01:00

Add Entity categories for Home Assistant (#2636)

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

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):