add lock state reporting
This commit is contained in:
parent
1e8e5664a2
commit
b06f65c0fc
|
@ -63,7 +63,6 @@ void user_init()
|
||||||
elcd.print("dashboard.pic=");
|
elcd.print("dashboard.pic=");
|
||||||
elcd.print(ac_lock ? "2" : "1");
|
elcd.print(ac_lock ? "2" : "1");
|
||||||
elcd_sendstop();
|
elcd_sendstop();
|
||||||
mqtt.subscribe(AC_LOCK_TOPIC, ac_lock_callback);
|
|
||||||
lt_bt.attachPop(lt_btn_cb, <_bt);
|
lt_bt.attachPop(lt_btn_cb, <_bt);
|
||||||
fan_bt.attachPop(fan_btn_cb, &fan_bt);
|
fan_bt.attachPop(fan_btn_cb, &fan_bt);
|
||||||
puri_bt.attachPop(puri_btn_cb, &puri_bt);
|
puri_bt.attachPop(puri_btn_cb, &puri_bt);
|
||||||
|
@ -292,4 +291,9 @@ void pwm_update_lcd() {
|
||||||
elcd.print("puri_bt.pic=");
|
elcd.print("puri_bt.pic=");
|
||||||
elcd.print(pwm_get_state(AIR_PURIFIER_PIN)?8:7);
|
elcd.print(pwm_get_state(AIR_PURIFIER_PIN)?8:7);
|
||||||
elcd_sendstop();
|
elcd_sendstop();
|
||||||
|
}
|
||||||
|
|
||||||
|
void mqtt_connected_user_callback() {
|
||||||
|
mqtt.subscribe(AC_LOCK_TOPIC, ac_lock_callback);
|
||||||
|
ac_lock_report();
|
||||||
}
|
}
|
|
@ -70,6 +70,7 @@ void ac_lock_callback(String topic, String payload);
|
||||||
void elcd_sendstop();
|
void elcd_sendstop();
|
||||||
void ac_update_lcd();
|
void ac_update_lcd();
|
||||||
void pwm_update_lcd();
|
void pwm_update_lcd();
|
||||||
|
void mqtt_connected_user_callback();
|
||||||
|
|
||||||
// ESPMega IoT Core Build-in Functions
|
// ESPMega IoT Core Build-in Functions
|
||||||
extern void pwm_set_state(int id, int state);
|
extern void pwm_set_state(int id, int state);
|
||||||
|
|
Loading…
Reference in New Issue