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

[core] Store component source strings in flash on ESP8266 (breaking change) (#10621)

This commit is contained in:
J. Nick Koston
2025-09-07 20:10:00 -05:00
committed by GitHub
parent 666e33e70b
commit 8d90f13e97
10 changed files with 62 additions and 68 deletions

View File

@@ -253,6 +253,19 @@ class StringLiteral(Literal):
return cpp_string_escape(self.string)
class LogStringLiteral(Literal):
"""A string literal that uses LOG_STR() macro for flash storage on ESP8266."""
__slots__ = ("string",)
def __init__(self, string: str) -> None:
super().__init__()
self.string = string
def __str__(self) -> str:
return f"LOG_STR({cpp_string_escape(self.string)})"
class IntLiteral(Literal):
__slots__ = ("i",)