SC01 display module standard graphic command don't work

I have a Panlee SC01 Plus display module. The below code will display a background picture and the button, but will not show the lines between “## Not working commands ##”. If I remove the code between “## External ha_deck commands ##”, than I only have a black screen with a the backlight ON. Does any one have an idea how I can draw lines and text beside using the ha_desk code?

substitutions:
  name: "wt32-sc01"
  friendly_name: "WT32-SC01"
  id_prefix: "wt32_sc01"

esphome:
  name: home-info-radio
  friendly_name: home-info-radio
esp32:
  board: esp32-s3-devkitc-1
  framework:
    type: arduino
logger:
api:
  encryption:
    key: xxxxx
ota:
  password: xxxxx
wifi:
  ssid: xxxxx
  password: xxxxx
captive_portal:

## External ha_deck commands ##
external_components:
  - source:
      type: git
      url: https://github.com/strange-v/ha_deck
      ref: main
    components: [ hd_device_sc01_plus, ha_deck ]

hd_device_sc01_plus:
  id: device
  brightness: 25

ha_deck:
  id: deck
  main_screen: scr_main
  screens:
    - name: scr_main
      widgets:
        - type: button
          position: 8, 8
          text: Rooms
          icon: 󰠡
          enabled: return true;
          on_click:
            lambda: id(deck).switch_screen("scr_rooms");
## External ha_deck commands ##

time:
  - platform: homeassistant
    id: homeassistant_time

output:
  - platform: gpio
    pin: GPIO45
    id: tst_Backlight

light:
  - platform: binary
    name: "${friendly_name} Back Light"
    output: tst_Backlight    
    id: ${id_prefix}_backlight
    restore_mode: ALWAYS_ON

spi:
  clk_pin: GPIO14
  mosi_pin: GPIO13
  miso_pin: GPIO12

display:
  # Resolution: 480x320
  - platform: ili9xxx
    id: ${id_prefix}_display
    model: ST7796
    cs_pin: GPIO15
    dc_pin: GPIO21
    reset_pin: GPIO4
    rotation: 270
## Not working commands ##
    lambda: |-
      int shift_x = (it.get_width()-310)/2;
      int shift_y = (it.get_height()-256)/2;
      for(auto i = 0; i<256; i++) {
        it.horizontal_line(shift_x+  0,i+shift_y,50, my_red.fade_to_white(i));
        it.horizontal_line(shift_x+ 50,i+shift_y,50, my_red.fade_to_black(i));
  
        it.horizontal_line(shift_x+105,i+shift_y,50, my_green.fade_to_white(i));
        it.horizontal_line(shift_x+155,i+shift_y,50, my_green.fade_to_black(i));
  
        it.horizontal_line(shift_x+210,i+shift_y,50, my_blue.fade_to_white(i));
        it.horizontal_line(shift_x+260,i+shift_y,50, my_blue.fade_to_black(i));
      }
      it.rectangle(shift_x+ 0, 0+shift_y, shift_x+ 310, 256+shift_y, my_yellow);
## Not working commands ##

image:
  - file: "grandprixradio.gif"
    id: grandprixradio
    resize: 90x60

font:
  - file:
      type: gfonts
      family: "Open Sans"
    id: my_font
    size: 20

color:
  - id: my_red
    red: 100%
    green: 3%
    blue: 5%
  - id: my_white
    red: 100%
    green: 100%
    blue: 100%

interval:
  - interval: 5s
    then:
      - component.update: wt32_sc01_display