Fix ESPHOME_PROJECT_VERSION_30 (#6731)

This commit is contained in:
Jesse Hills 2024-05-14 09:42:53 +12:00 committed by GitHub
parent eae97dbaa0
commit 47b40505c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -394,7 +394,7 @@ async def to_code(config):
if project_conf := config.get(CONF_PROJECT): if project_conf := config.get(CONF_PROJECT):
cg.add_define("ESPHOME_PROJECT_NAME", project_conf[CONF_NAME]) cg.add_define("ESPHOME_PROJECT_NAME", project_conf[CONF_NAME])
cg.add_define("ESPHOME_PROJECT_VERSION", project_conf[CONF_VERSION]) cg.add_define("ESPHOME_PROJECT_VERSION", project_conf[CONF_VERSION])
cg.add_define("ESPHOME_PROJECT_VERSION_30", project_conf[CONF_VERSION][:30]) cg.add_define("ESPHOME_PROJECT_VERSION_30", project_conf[CONF_VERSION][:29])
for conf in project_conf.get(CONF_ON_UPDATE, []): for conf in project_conf.get(CONF_ON_UPDATE, []):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID]) trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID])
await cg.register_component(trigger, conf) await cg.register_component(trigger, conf)