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

Make string globals persist-able using fixed size allocations (#5296)

Co-authored-by: Daniel Dunn <dannydunn@eternityforest.com>
This commit is contained in:
Daniel Dunn
2023-09-11 15:26:00 -06:00
committed by GitHub
parent c930c86cfa
commit 10eee47b6b
4 changed files with 89 additions and 4 deletions

View File

@@ -663,7 +663,11 @@ async def process_lambda(
:param return_type: The return type of the lambda.
:return: The generated lambda expression.
"""
from esphome.components.globals import GlobalsComponent, RestoringGlobalsComponent
from esphome.components.globals import (
GlobalsComponent,
RestoringGlobalsComponent,
RestoringGlobalStringComponent,
)
if value is None:
return
@@ -676,6 +680,7 @@ async def process_lambda(
and (
full_id.type.inherits_from(GlobalsComponent)
or full_id.type.inherits_from(RestoringGlobalsComponent)
or full_id.type.inherits_from(RestoringGlobalStringComponent)
)
):
parts[i * 3 + 1] = var.value()