@@ -11,6 +11,7 @@ esphome:
1111 - ' -DHAS_DISPLAY'
1212
1313spi :
14+ id : display_spi
1415 clk_pin : GPIO2
1516 mosi_pin : GPIO3
1617 interface : hardware
@@ -108,10 +109,20 @@ display:
108109 );
109110
110111 // Symbols indicating state of water tank emptiness and rain sensor
112+ #ifdef HAS_CUSTOM_INPUTS
111113 it.printf(
112- 42, 22, material, TextAlign::TOP_CENTER, "%s%s%s",
113- id(${water_tank_empty_id}).state ? "\U0000f6d5": "\U0000f6d6",
114- id(${rain_sensor_id}).state ? "\U0000f176" : "\U0000e81a",
114+ 30, 22, material, TextAlign::TOP_CENTER,
115+ "%s%s",
116+ ${water_tank_empty_id}->state ? "\U0000f6d5": "\U0000f6d6",
117+ ${rain_sensor_id}->state ? "\U0000f176" : "\U0000e81a"
118+ );
119+ #endif // HAS_CUSTOM_INPUTS
120+
121+ // Symbol indicating state of peripherals power relay, same vertical
122+ // position as the previous ones
123+ it.printf(
124+ 66, 22, material, TextAlign::TOP_CENTER,
125+ "%s",
115126 id(${peripherals_power_off_relay_id}).state ? "\U0000e224" : ""
116127 );
117128
@@ -168,6 +179,7 @@ display:
168179
169180 - id : display_page2
170181 lambda : |-
182+ #ifdef USE_WIFI
171183 #include <esphome/components/wifi/wifi_component.h>
172184 using namespace esphome::wifi;
173185
@@ -180,8 +192,10 @@ display:
180192 84, 14, primary, TextAlign::CENTER_RIGHT, "%i dBm",
181193 global_wifi_component->wifi_rssi()
182194 );
183-
184- } else {
195+ } else
196+ #endif // USE_WIFI
197+ // Always show WiFi disconnected symbol if WiFi is not used
198+ {
185199 it.print(0, 14, material, TextAlign::CENTER_LEFT, "\U0000e648");
186200 it.print(84, 14, primary, TextAlign::CENTER_RIGHT, " ");
187201 }
0 commit comments