Advertisement
TuXaMaT

GC9A01A

Mar 25th, 2024
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.51 KB | None | 0 0
  1. esphome:
  2.   name: test
  3.   friendly_name: Test
  4.  
  5. esp32:
  6.   board: esp32dev
  7.   framework:
  8.     type: arduino
  9.  
  10. # Enable logging
  11. logger:
  12. # Enable Home Assistant API
  13. api:
  14.   encryption:
  15.     key: "xxx"
  16.  
  17. ota:
  18.   password: "20f1750777b514137feab7b261e3e24d"
  19.  
  20. wifi:
  21.   ssid: !secret wifi_ssid
  22.   password: !secret wifi_password
  23.  
  24.   # Enable fallback hotspot (captive portal) in case wifi connection fails
  25.   ap:
  26.     ssid: "Test Fallback Hotspot"
  27.     password: "CC914OuW5O14"
  28.  
  29. captive_portal:
  30. web_server:
  31.   port: 80
  32. time: # Время берем из Home Assistant
  33.   - platform: homeassistant
  34.     id: homeassistant_time
  35.  
  36. light:
  37.   - platform: neopixelbus
  38.     type: GRB
  39.     variant: WS2811
  40.     pin: GPIO23
  41.     num_leds: 8
  42.     name: "NeoPixel Light"
  43.  
  44. font:
  45.   - file: "fonts/arial.ttf"
  46.     id: arialfont
  47.     size: 20
  48. image:
  49.   - file: "img/logo_ha.png"
  50.     id: logo_ha
  51. #    type: RGB565
  52.     resize: 240x240
  53.  
  54. display:
  55.   - platform: ili9xxx
  56.     model: GC9A01A
  57.     dimensions:
  58.       height: 240
  59.       width: 240
  60.     cs_pin: GPIO5
  61.     dc_pin: GPIO4
  62.     reset_pin: GPIO13
  63.     lambda: |-
  64.    
  65.        // Print "Test" in top center.
  66.        it.printf(85, 104, id(arialfont), id(red),  TextAlign::TOP_CENTER, "Test");
  67.    
  68.        // Draw the image logo at position [x=10,y=5]
  69.        it.image(10, 5, id(logo_ha));
  70.  
  71.  
  72. spi:
  73.   clk_pin: GPIO18
  74.   mosi_pin: GPIO22
  75.   miso_pin: GPIO19
  76.  
  77. color:
  78.   - id: yellow
  79.     red: 100%
  80.     green: 100%
  81.     blue: 0%
  82.  
  83.   - id: red
  84.     red: 100%
  85.     green: 0%
  86.     blue: 0%
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement