From 83e3e7be3dd9612b44d48a220ad3199f06cfb4b2 Mon Sep 17 00:00:00 2001
From: 3D <3d@n3rd3d.com>
Date: Sat, 7 Jan 2023 01:47:10 +0100
Subject: [PATCH] update display02 change to esp32

---
 .../templates/config/esphome_display02.yaml   | 44 ++++++++++++-------
 1 file changed, 28 insertions(+), 16 deletions(-)

diff --git a/intern/docker_esphome/templates/config/esphome_display02.yaml b/intern/docker_esphome/templates/config/esphome_display02.yaml
index 7273a514..6aeb7653 100644
--- a/intern/docker_esphome/templates/config/esphome_display02.yaml
+++ b/intern/docker_esphome/templates/config/esphome_display02.yaml
@@ -3,9 +3,9 @@
 {% include "/includes/ansible.inc.yaml" %}
 
 {% include "/includes/board.d1_mini.inc.yaml" %}
-  # force newline 
+
+
   platformio_options:
-    upload_speed: 115200
     lib_deps:
       - Wire                            # Also required by GFX.
       - SPI                             # Also required by GFX.
@@ -18,7 +18,8 @@ external_components:
     components: [ obegraensad_panel ]
     refresh: 0s
 {% include "/includes/common.inc.yaml" %}
-# force newline
+
+
   on_message:
     - topic: ESPHome/{{ devicename }}/state/command
       payload: "ON"
@@ -34,25 +35,36 @@ light:
     name: 'Brightness'
     id: matrix_light
     output: matrix_brightness
-    restore_mode: RESTORE_DEFAULT_ON
+    restore_mode: ALWAYS_ON
 
 output:
-  - platform: esp8266_pwm
+  - platform: ledc
     # Enables brightness control.
     id: matrix_brightness
     pin:
-      number: GPIO14
+      number: GPIO25
       inverted: True
 
 globals:
-   - id: coords
-     type: int
-     restore_value: no
-     initial_value: '0'
-   - id: length
-     type: int
-     restore_value: no
-     initial_value: '0'
+  - id: coords
+    type: int
+    restore_value: no
+    initial_value: '0'
+  - id: length
+    type: int
+    restore_value: no
+    initial_value: '0'
+
+binary_sensor:
+- platform: gpio
+  pin: 
+    number: GPIO26
+    inverted: true
+    mode:
+      input: true
+      pullup: true
+  id: button
+  name: button
 
 time:
   - platform: sntp
@@ -100,8 +112,8 @@ text_sensor:
 display:
   - platform: obegraensad_panel
     latch_pin: 12
-    clock_pin: 04
-    data_pin: 05
+    clock_pin: 14
+    data_pin: 27
     id: my_display
     pages:
       - id: Page1
-- 
GitLab