From 841c35d00d421984682cecadd53e32dc2fe5cb34 Mon Sep 17 00:00:00 2001 From: landon rohatensky Date: Tue, 12 Sep 2023 09:02:27 -0700 Subject: [PATCH] add unit encoder c package --- common/UnitEncoderC.yaml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 common/UnitEncoderC.yaml diff --git a/common/UnitEncoderC.yaml b/common/UnitEncoderC.yaml new file mode 100644 index 00000000..eac9a63f --- /dev/null +++ b/common/UnitEncoderC.yaml @@ -0,0 +1,24 @@ +UnitEncoderC: + id: encoder_base + i2c_id: bus_a + button: + name: "${friendly_name} Rotary Button" + id: rotary_button + internal: True + on_press: + then: + - lambda: |- + id(homeThingMenu)->buttonPressSelect(); + encoder: + name: "${friendly_name} Rotary Encoder" + id: rotary + internal: True + encoder_filter: 2 + on_clockwise: + - lambda: |- + id(homeThingMenu)->buttonPressWakeUpDisplay(); + id(homeThingMenu)->rotaryScrollClockwise(id(rotary).state); + on_anticlockwise: + - lambda: |- + id(homeThingMenu)->buttonPressWakeUpDisplay(); + id(homeThingMenu)->rotaryScrollCounterClockwise(id(rotary).state); \ No newline at end of file