mirror of
https://github.com/esphome/esphome.git
synced 2026-09-30 08:20:21 +00:00
[sensor] Use register_apply_action for sensor.template.publish (#19507)
This commit is contained in:
@@ -5,6 +5,17 @@ sensor:
|
||||
id: source_sensor
|
||||
lambda: return 42.0;
|
||||
update_interval: 1s
|
||||
on_value:
|
||||
- sensor.template.publish:
|
||||
id: publish_target
|
||||
state: 42.0
|
||||
- sensor.template.publish:
|
||||
id: publish_target
|
||||
state: !lambda "return x * 2.0;"
|
||||
|
||||
- platform: template
|
||||
name: "Publish Target"
|
||||
id: publish_target
|
||||
|
||||
# Streaming filters (window_size == send_every) - uses StreamingFilter base class
|
||||
- platform: copy
|
||||
|
||||
Reference in New Issue
Block a user