1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

Add rotary_encoder.set_value action (#747)

* Add rotary_encoder.set_value action

Fixes https://github.com/esphome/feature-requests/issues/389

* Fix
This commit is contained in:
Otto Winter
2019-10-17 19:14:52 +02:00
committed by GitHub
parent 95c883ae9b
commit 996c50e8f2
3 changed files with 42 additions and 2 deletions

View File

@@ -491,6 +491,7 @@ sensor:
update_interval: 15s
- platform: rotary_encoder
name: "Rotary Encoder"
id: rotary_encoder1
pin_a: GPIO23
pin_b: GPIO24
pin_reset: GPIO25
@@ -501,6 +502,13 @@ sensor:
resolution: 4
min_value: -10
max_value: 30
on_value:
- sensor.rotary_encoder.set_value:
id: rotary_encoder1
value: 10
- sensor.rotary_encoder.set_value:
id: rotary_encoder1
value: !lambda 'return -1;'
- platform: pulse_width
name: Pulse Width
pin: GPIO12