mirror of
https://github.com/esphome/esphome-docs.git
synced 2025-03-13 13:50:15 +01:00
Custom Binary Sensor: Add missing ";" and fix indentation in YAML (#164)
Example would not compile while the semicolon ";" was missing.
This commit is contained in:
parent
26be1d3c22
commit
7c03e1ff8f
@ -29,7 +29,7 @@ same as the gpio binary sensor.
|
||||
// This will be called every "update_interval" milliseconds.
|
||||
|
||||
// Publish an OFF state
|
||||
bool state = digitalRead(5)
|
||||
bool state = digitalRead(5);
|
||||
publish_state(state);
|
||||
}
|
||||
};
|
||||
@ -46,14 +46,14 @@ And in YAML:
|
||||
- my_binary_sensor.h
|
||||
|
||||
binary_sensor:
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
auto my_custom_sensor = new MyCustomBinarySensor();
|
||||
App.register_component(my_custom_sensor);
|
||||
return {my_custom_sensor};
|
||||
- platform: custom
|
||||
lambda: |-
|
||||
auto my_custom_sensor = new MyCustomBinarySensor();
|
||||
App.register_component(my_custom_sensor);
|
||||
return {my_custom_sensor};
|
||||
|
||||
binary_sensors:
|
||||
name: "My Custom Binary Sensor"
|
||||
binary_sensors:
|
||||
name: "My Custom Binary Sensor"
|
||||
|
||||
Configuration variables:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user