From 0cb5d736733861fc7a05d851461473bcfe7fcb56 Mon Sep 17 00:00:00 2001 From: Martijn Date: Sun, 27 Oct 2024 19:56:33 +0100 Subject: [PATCH] added base.yaml --- package/1bar_1display.yaml | 54 +---------- package/2bar_1display.yaml | 194 +++++++++++++++++++++++++++++++++++++ package/base.yaml | 51 ++++++++++ 3 files changed, 249 insertions(+), 50 deletions(-) create mode 100644 package/2bar_1display.yaml create mode 100644 package/base.yaml diff --git a/package/1bar_1display.yaml b/package/1bar_1display.yaml index 793855c..5cd63c5 100644 --- a/package/1bar_1display.yaml +++ b/package/1bar_1display.yaml @@ -1,18 +1,5 @@ -i2c: - - id: temperature_sensor - sda: GPIO1 - scl: GPIO2 - scan: true - - id: buttons - sda: GPIO47 - scl: GPIO48 - scan: true - frequency: 400khz - -spi: - clk_pin: GPIO36 - mosi_pin: GPIO35 - # miso_pin: GPIOXX +packages: + base: !include base.yaml mcp23008: # - id: 'base_J0' @@ -26,17 +13,6 @@ mcp23008: i2c_id: buttons address: 0x23 -# Define a PWM output on the ESP32 -output: - - platform: ledc - pin: GPIO46 - id: displays_mini_backlight_pwm - inverted: True - - platform: ledc - pin: GPIO3 - id: display_main_backlight_pwm - inverted: True - binary_sensor: - platform: gpio id: 'base_j2_btn_left' @@ -74,31 +50,9 @@ binary_sensor: mode: INPUT_PULLUP inverted: true -sensor: - - platform: sts3x - id: inside_temperature - i2c_id: temperature_sensor - name: "Temperature" - address: 0x4A - update_interval: 10s - light: - - platform: monochromatic - output: displays_mini_backlight_pwm - name: "Mini Display Backlight" - id: displays_mini_backlight - restore_mode: ALWAYS_ON - - platform: monochromatic - output: display_main_backlight_pwm - name: "Main Display Backlight" - id: display_main_backlight - restore_mode: ALWAYS_ON - - platform: neopixelbus - id: neopixels - type: RGB - variant: WS2812 - pin: GPIO4 - num_leds: 8 + - id: !extend neopixels + num_leds: 5 - platform: partition name: "BAR J3 Left RGB Front" id: bar_j3_left_rgb_front diff --git a/package/2bar_1display.yaml b/package/2bar_1display.yaml new file mode 100644 index 0000000..8e3bd15 --- /dev/null +++ b/package/2bar_1display.yaml @@ -0,0 +1,194 @@ +packages: + base: !include base.yaml + +mcp23008: + # - id: 'base_J0' + # address: 0x20 + - id: 'base_J1' + address: 0x21 + - id: 'base_J2' + i2c_id: buttons + address: 0x22 + - id: 'base_J3' + i2c_id: buttons + address: 0x23 + +binary_sensor: + - platform: gpio + id: 'base_j1_btn_left' + name: "Display button Left" + pin: + mcp23xxx: base_J1 + number: 6 + mode: INPUT_PULLUP + inverted: true + + - platform: gpio + id: 'base_j1_btn_right' + name: "Display button Right" + pin: + mcp23xxx: base_J1 + number: 2 + mode: INPUT_PULLUP + inverted: true + + - platform: gpio + id: 'base_j2_btn_left' + name: "BAR 1 button Left" + pin: + mcp23xxx: base_J2 + number: 6 + mode: INPUT_PULLUP + inverted: true + + - platform: gpio + id: 'base_j2_btn_right' + name: "BAR 1 button Right" + pin: + mcp23xxx: base_J2 + number: 2 + mode: INPUT_PULLUP + inverted: true + + - platform: gpio + id: 'base_j3_btn_left' + name: "BAR 2 button Left" + pin: + mcp23xxx: base_J3 + number: 6 + mode: INPUT_PULLUP + inverted: true + + - platform: gpio + id: 'base_j3_btn_right' + name: "BAR 2 button Right" + pin: + mcp23xxx: base_J3 + number: 2 + mode: INPUT_PULLUP + inverted: true + +light: + - id: !extend neopixels + num_leds: 9 + - platform: partition + name: "BAR 1 Left RGB Front" + id: bar_1_left_rgb_front + segments: + - id: neopixels + from: 0 + to: 0 + - platform: partition + name: "BAR 1 Left RGB Back" + id: bar_1_left_rgb_back + segments: + - id: neopixels + from: 1 + to: 1 + - platform: partition + name: "BAR 1 Right RGB Front" + id: bar_1_right_rgb_front + segments: + - id: neopixels + from: 2 + to: 2 + - platform: partition + name: "BAR 1 Right RGB Back" + id: bar_1_right_rgb_back + segments: + - id: neopixels + from: 3 + to: 3 + - platform: partition + name: "BAR 2 Left RGB Front" + id: bar_2_left_rgb_front + segments: + - id: neopixels + from: 4 + to: 4 + - platform: partition + name: "BAR 2 Left RGB Back" + id: bar_2_left_rgb_back + segments: + - id: neopixels + from: 5 + to: 5 + - platform: partition + name: "BAR 2 Right RGB Front" + id: bar_2_right_rgb_front + segments: + - id: neopixels + from: 6 + to: 6 + - platform: partition + name: "BAR 2 Right RGB Back" + id: bar_2_right_rgb_back + segments: + - id: neopixels + from: 7 + to: 7 + +time: + - platform: homeassistant + id: esptime + +display: + - id: display_j2_main + platform: ili9xxx + model: ili9341 + invert_colors: false + dc_pin: + number: GPIO37 + allow_other_uses: true + cs_pin: + mcp23xxx: base_J2 + number: 5 + mode: + output: true + inverted: false + update_interval: 200ms + show_test_card: false + dimensions: + height: 240 + width: 320 + rotation: 180 + - id: display_j3_Left + platform: ili9xxx + model: ST7735 + dc_pin: + number: GPIO37 + allow_other_uses: true + cs_pin: + mcp23xxx: base_J3 + number: 5 + mode: + output: true + inverted: false + invert_colors: false + show_test_card: false + dimensions: + height: 160 + width: 80 + offset_width: 24 + rotation: 270 + update_interval: 1s + - id: display_j3_Right + platform: ili9xxx + model: ST7735 + dc_pin: + number: GPIO37 + allow_other_uses: true + cs_pin: + mcp23xxx: base_J3 + number: 1 + mode: + output: true + inverted: false + invert_colors: false + show_test_card: false + dimensions: + height: 160 + width: 80 + offset_width: 24 + rotation: 90 + update_interval: 1s \ No newline at end of file diff --git a/package/base.yaml b/package/base.yaml new file mode 100644 index 0000000..5969c4d --- /dev/null +++ b/package/base.yaml @@ -0,0 +1,51 @@ +i2c: + - id: temperature_sensor + sda: GPIO1 + scl: GPIO2 + scan: true + - id: buttons + sda: GPIO47 + scl: GPIO48 + scan: true + frequency: 400khz + +spi: + clk_pin: GPIO36 + mosi_pin: GPIO35 + # miso_pin: GPIOXX + +output: + - platform: ledc + pin: GPIO46 + id: displays_mini_backlight_pwm + inverted: True + - platform: ledc + pin: GPIO3 + id: display_main_backlight_pwm + inverted: True + +sensor: + - platform: sts3x + id: inside_temperature + i2c_id: temperature_sensor + name: "Temperature" + address: 0x4A + update_interval: 10s + +light: + - platform: neopixelbus + id: neopixels + type: RGB + variant: WS2812 + pin: GPIO4 + num_leds: 20 + - platform: monochromatic + output: displays_mini_backlight_pwm + name: "Mini Display Backlight" + id: displays_mini_backlight + restore_mode: ALWAYS_ON + - platform: monochromatic + output: display_main_backlight_pwm + name: "Main Display Backlight" + id: display_main_backlight + restore_mode: ALWAYS_ON \ No newline at end of file