mirror of
https://github.com/esphome/esphome.git
synced 2026-02-25 21:43:14 -07:00
[binary_sensor] Fix reporting of 'unknown' (#12296)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@home-assistant.io>
This commit is contained in:
committed by
Jonathan Swoboda
parent
42811edeb4
commit
fb7800a22f
@@ -0,0 +1,39 @@
|
||||
esphome:
|
||||
name: test-binary-sensor-invalidate
|
||||
|
||||
host:
|
||||
api:
|
||||
batch_delay: 0ms # Disable batching to receive all state updates
|
||||
logger:
|
||||
level: DEBUG
|
||||
|
||||
# Template binary sensor that we can control
|
||||
binary_sensor:
|
||||
- platform: template
|
||||
name: "Test Binary Sensor"
|
||||
id: test_binary_sensor
|
||||
|
||||
# Buttons to control the binary sensor state
|
||||
button:
|
||||
- platform: template
|
||||
name: "Set True"
|
||||
id: set_true_button
|
||||
on_press:
|
||||
- binary_sensor.template.publish:
|
||||
id: test_binary_sensor
|
||||
state: true
|
||||
|
||||
- platform: template
|
||||
name: "Set False"
|
||||
id: set_false_button
|
||||
on_press:
|
||||
- binary_sensor.template.publish:
|
||||
id: test_binary_sensor
|
||||
state: false
|
||||
|
||||
- platform: template
|
||||
name: "Invalidate State"
|
||||
id: invalidate_button
|
||||
on_press:
|
||||
- binary_sensor.invalidate_state:
|
||||
id: test_binary_sensor
|
||||
Reference in New Issue
Block a user