update ac code

This commit is contained in:
reaw55 2023-12-27 01:01:13 +07:00
parent aec65f3292
commit 9a11c68ffc
1 changed files with 31 additions and 8 deletions

View File

@ -340,22 +340,45 @@ void update_lcd_ac() {
// Fan Speed 0: Auto, 1: High, 2: Mid, 3: Low
uint8_t fan_speed = ac_get_fan_speed();
if(fan_speed == 0) {
fan.Set_background_image_pic(18);
//fan.Set_background_image_pic(18);
elcd_send_stop_bit();
elcd.print("fan.pic=18");
elcd_send_stop_bit();
} else if(fan_speed == 1) {
fan.Set_background_image_pic(19);
//fan.Set_background_image_pic(19);
elcd_send_stop_bit();
elcd.print("fan.pic=19");
elcd_send_stop_bit();
} else if(fan_speed == 2) {
fan.Set_background_image_pic(21);
//fan.Set_background_image_pic(21);
elcd_send_stop_bit();
elcd.print("fan.pic=21");
elcd_send_stop_bit();
} else if(fan_speed == 3) {
fan.Set_background_image_pic(20);
//fan.Set_background_image_pic(20);
elcd_send_stop_bit();
elcd.print("fan.pic=20");
elcd_send_stop_bit();
} else {
fan.Set_background_image_pic(18);
//fan.Set_background_image_pic(18);
elcd_send_stop_bit();
elcd.print("fan.pic=18");
elcd_send_stop_bit();
}
//update the mode cool is 22, fan mode is 24, for off the toggle button act as indicator
//Mode 0: Off, 1: Cool, 2: Fan
uint8_t mode_state = ac_get_mode();
mode.Set_background_image_pic(mode_state==1?22:24);
//mode.Set_background_image_pic(mode_state==1?22:24);
elcd_send_stop_bit();
elcd.print("mode.pic=");
elcd.print(mode_state==1?22:24);
elcd_send_stop_bit();
//update the ac toggle button
ac_toggle.Set_background_image_pic(ac_get_mode()==0?1:2);
//ac_toggle.Set_background_image_pic(ac_get_mode()==0?1:2);
elcd_send_stop_bit();
elcd.print("ac_toggle.pic=");
elcd.print(ac_get_mode()==0?1:2);
elcd_send_stop_bit();
}
@ -400,7 +423,7 @@ void timer_tick_callback()
}
void ac_changed_user_callback(int mode, int temperature, int fan_speed) {
update_lcd_ac()
}
void mqtt_connected_user_callback() {