Merge branch 'current' into patch-1

This commit is contained in:
Piotr Kubiak 2022-11-13 14:34:33 +01:00 committed by GitHub
commit 1b5ebcdaf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ Button Component
.. note::
To attach a physical buttons to ESPHome, see
To attach a physical button to ESPHome, see
:doc:`GPIO Binary Sensor </components/binary_sensor/gpio>`.
ESPHome has support for components to create button entities in Home Assistant. A button entity is

View File

@ -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";
});
}