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

[api] `homeassistant.action replaces homeassistant.service` (#7171)

This commit is contained in:
Jesse Hills
2024-08-01 22:38:36 +12:00
committed by GitHub
parent 144f1d3663
commit cb9906b921
5 changed files with 103 additions and 63 deletions

View File

@@ -2181,3 +2181,13 @@ SOURCE_SCHEMA = Any(
}
),
)
def rename_key(old_key, new_key):
def validator(config: dict) -> dict:
config = config.copy()
if old_key in config:
config[new_key] = config.pop(old_key)
return config
return validator