Merge branch 'dev' into api_heap_churn_info

This commit is contained in:
J. Nick Koston 2025-07-28 13:41:46 -10:00 committed by GitHub
commit 397bc80a15
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 0 deletions

View File

@ -516,6 +516,7 @@ def binary_sensor_schema(
icon: str = cv.UNDEFINED,
entity_category: str = cv.UNDEFINED,
device_class: str = cv.UNDEFINED,
filters: list = cv.UNDEFINED,
) -> cv.Schema:
schema = {}
@ -527,6 +528,7 @@ def binary_sensor_schema(
(CONF_ICON, icon, cv.icon),
(CONF_ENTITY_CATEGORY, entity_category, cv.entity_category),
(CONF_DEVICE_CLASS, device_class, validate_device_class),
(CONF_FILTERS, filters, validate_filters),
]:
if default is not cv.UNDEFINED:
schema[cv.Optional(key, default=default)] = validator

View File

@ -332,6 +332,7 @@ def sensor_schema(
device_class: str = cv.UNDEFINED,
state_class: str = cv.UNDEFINED,
entity_category: str = cv.UNDEFINED,
filters: list = cv.UNDEFINED,
) -> cv.Schema:
schema = {}
@ -346,6 +347,7 @@ def sensor_schema(
(CONF_DEVICE_CLASS, device_class, validate_device_class),
(CONF_STATE_CLASS, state_class, validate_state_class),
(CONF_ENTITY_CATEGORY, entity_category, sensor_entity_category),
(CONF_FILTERS, filters, validate_filters),
]:
if default is not cv.UNDEFINED:
schema[cv.Optional(key, default=default)] = validator

View File

@ -162,6 +162,7 @@ def text_sensor_schema(
device_class: str = cv.UNDEFINED,
entity_category: str = cv.UNDEFINED,
icon: str = cv.UNDEFINED,
filters: list = cv.UNDEFINED,
) -> cv.Schema:
schema = {}
@ -172,6 +173,7 @@ def text_sensor_schema(
(CONF_ICON, icon, cv.icon),
(CONF_DEVICE_CLASS, device_class, validate_device_class),
(CONF_ENTITY_CATEGORY, entity_category, cv.entity_category),
(CONF_FILTERS, filters, validate_filters),
]:
if default is not cv.UNDEFINED:
schema[cv.Optional(key, default=default)] = validator