Thermostat how to show Mode to LCD

Hello
I’m trying to show thermostat Mode OFF and Heat to LCD display, but I can’t find how. I’m using the st7920 LCD. I need to show “id(livingroom_thermostat).mode”
My code is:

display:
  - platform: st7920
    id: lcd
    update_interval: 10s
    cs_pin:
      number: 33
      inverted: true
    width: 128
    height: 64
    lambda: |-
      it.strftime(0, 28, id(my_font), TextAlign::BASELINE_LEFT, "%H:%M", id(esptime).now());
      it.strftime(95, 11, id(my_font1), TextAlign::BASELINE_LEFT, "%a", id(esptime).now());
      it.strftime(95, 25, id(my_font1), TextAlign::BASELINE_LEFT, "%d.%m.", id(esptime).now());
      it.line(0, 31, 127, 31);
      if (id(heating).state) {it.image(112, 48, id(fire_image));}
      it.printf(0, 45, id(my_font1), TextAlign::BASELINE_LEFT, "T%.1f°C", id(livingroom_temp).state);
      it.printf(0, 60, id(my_font1), TextAlign::BASELINE_LEFT, "H%.1f%%", id(livingroom_humidity).state);
      it.printf(55, 45, id(my_font1), TextAlign::BASELINE_LEFT, "Tset:%.1f°C", id(livingroom_thermostat).target_temperature);      

climate:
  - platform: thermostat
    name: "Livingroom Radiator"
    sensor: livingroom_temp
    default_target_temperature_low: 10 °C
    id: livingroom_thermostat
    min_heating_off_time: 0s
    min_heating_run_time: 0s
    min_idle_time: 0s
    visual:
      min_temperature: 10 °C
      max_temperature: 30 °C
    # heat_deadband: 0.3
    # heat_overrun: 0.3
    heat_action:
      then:
        - output.turn_on: livingroom_radiator_out
        - lambda: id(heating).publish_state(true);
    idle_action:
      then:
        - output.turn_off: livingroom_radiator_out
        - lambda: id(heating).publish_state(false);

Can please someone help me.
Thanks

With no logs and no description of what goes wrong, I doubt it.

My code is working. But I need to implement one more line for showing the mode status of thermostat. But I don’t know how to create it.printf line.
If I create line like state it’s not working.
it.printf(55, 60, id(my_font1), TextAlign::BASELINE_LEFT, "%.1f", id(livingroom_thermostat).mode);

I need to know how to do this line to work

The id(livingroom_thermostat).mode is an integer, however you can translate that to a text using a internal function from the climate class.

Try

it.printf(55, 60, id(my_font1), TextAlign::BASELINE_LEFT, "%s", (char*) climate_mode_to_string(id(livingroom_thermostat).mode);

I add one more ) at the end, and it’s working.

it.printf(55, 60, id(my_font1), TextAlign::BASELINE_LEFT, "%s", (char*) climate_mode_to_string(id(livingroom_thermostat).mode));

Thanks, you are a life saver.