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

Co-authored-by: Daniel Dunn <dannydunn@eternityforest.com>
This commit is contained in:
Daniel DunnandDaniel Dunn authored and GitHub committed 2023-09-12 09:26:00 +12:00
1 parent c930c86cfa
commit 10eee47b6b
4 files changed
+89 -4

No files matched your search

+6 -1
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()