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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user