1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-24 22:22:22 +01:00

Resolve esphome::optional vs std::optional ambiguity in code generation (#9119)

This commit is contained in:
J. Nick Koston
2025-06-17 20:04:45 +02:00
committed by GitHub
parent 78c8447d1e
commit bf161f1eaa
2 changed files with 4 additions and 2 deletions

View File

@@ -29,7 +29,9 @@ Component = esphome_ns.class_("Component")
ComponentPtr = Component.operator("ptr")
PollingComponent = esphome_ns.class_("PollingComponent", Component)
Application = esphome_ns.class_("Application")
optional = esphome_ns.class_("optional")
# Create optional with explicit namespace to avoid ambiguity with std::optional
# The generated code will use esphome::optional instead of just optional
optional = global_ns.namespace("esphome").class_("optional")
arduino_json_ns = global_ns.namespace("ArduinoJson")
JsonObject = arduino_json_ns.class_("JsonObject")
JsonObjectConst = arduino_json_ns.class_("JsonObjectConst")