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