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

[config] Add entity schema consts with deprecation log (#8747)

This commit is contained in:
Jesse Hills
2025-05-12 18:31:36 +12:00
committed by GitHub
parent 401c090edd
commit 8324b3244c
5 changed files with 37 additions and 0 deletions

View File

@@ -2072,3 +2072,20 @@ def rename_key(old_key, new_key):
return config
return validator
# Remove before 2025.11.0
def deprecated_schema_constant(entity_type: str):
def validator(config):
_LOGGER.warning(
"Using `%s.%s_SCHEMA` is deprecated and will be removed in ESPHome 2025.11.0. "
"Please use `%s.%s_schema(...)` instead. "
"If you are seeing this, report an issue to the external_component author and ask them to update it.",
entity_type,
entity_type.upper(),
entity_type,
entity_type,
)
return config
return validator