mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-12-25 17:17:54 +01:00
Remove pointer reference to JsonObject calls. (#2294)
This commit is contained in:
parent
8dc2229187
commit
e7ba602c29
@ -157,7 +157,7 @@ custom components that communicate using MQTT.
|
||||
publish("the/other/topic", 42);
|
||||
}
|
||||
}
|
||||
void on_json_message(JsonObject &root) {
|
||||
void on_json_message(JsonObject root) {
|
||||
if (!root.containsKey("key"))
|
||||
return;
|
||||
|
||||
@ -165,7 +165,7 @@ custom components that communicate using MQTT.
|
||||
// do something with Json Object
|
||||
|
||||
// publish JSON using lambda syntax
|
||||
publish_json("the/other/json/topic", [=](JsonObject &root2) {
|
||||
publish_json("the/other/json/topic", [=](JsonObject root2) {
|
||||
root2["key"] = "Hello World";
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user