1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-05 12:52:19 +01:00

Revert "preen"

This reverts commit da9a7c41d1.
This commit is contained in:
J. Nick Koston
2025-09-03 22:16:41 -05:00
parent b04f4e949d
commit aadbc41d6a
2 changed files with 5 additions and 13 deletions

View File

@@ -6,14 +6,3 @@
#ifdef USE_ARDUINO
#include <Arduino.h>
#endif
// Portable PROGMEM string macro
// On ESP8266, PSTR() stores strings in flash memory
// On other platforms, it's a no-op
#ifndef ESPHOME_PSTR
#ifdef USE_ESP8266
#define ESPHOME_PSTR(x) PSTR(x)
#else
#define ESPHOME_PSTR(x) (x)
#endif
#endif

View File

@@ -76,8 +76,11 @@ async def register_component(var, config):
"Error while finding name of component, please report this", exc_info=e
)
if name is not None:
# Use ESPHOME_PSTR macro which stores strings in PROGMEM on ESP8266, no-op on other platforms
add(var.set_component_source(RawExpression(f'ESPHOME_PSTR("{name}")')))
# On ESP8266, store component source strings in PROGMEM to save RAM
if CORE.is_esp8266:
add(var.set_component_source(RawExpression(f'PSTR("{name}")')))
else:
add(var.set_component_source(name))
add(App.register_component(var))
return var