Skip to content

Commit

Permalink
fix missing button when turning on BLE (#22770)
Browse files Browse the repository at this point in the history
  • Loading branch information
Staars authored Jan 5, 2025
1 parent 2263305 commit 17ab5a5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tasmota/include/xsns_62_esp32_mi.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ struct {
uint32_t handleEveryDevice:1;
} option;
#ifdef USE_MI_EXT_GUI
uint32_t widgetSlot;
uint32_t widgetSlot = 0;
#ifdef USE_ENERGY_SENSOR
uint8_t energy_history[24];
#endif //USE_ENERGY_SENSOR
Expand Down
23 changes: 14 additions & 9 deletions tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -2624,7 +2624,6 @@ void MI32sendWidget(uint32_t slot){
}

void MI32InitGUI(void){
MI32.widgetSlot=0;
WSContentStart_P("m32");
WSContentSend_P(HTTP_MI32_SCRIPT_1);
WSContentSendStyle();
Expand Down Expand Up @@ -2938,6 +2937,20 @@ int ExtStopBLE(){

bool Xsns62(uint32_t function)
{

#ifdef USE_WEBSERVER
#ifdef USE_MI_EXT_GUI
switch (function) {
case FUNC_WEB_ADD_MAIN_BUTTON:
WSContentSend_P(HTTP_BTN_MENU_MI32);
break;
case FUNC_WEB_ADD_HANDLER:
WebServer_on(PSTR("/m32"), MI32HandleWebGUI);
break;
}
#endif //USE_MI_EXT_GUI
#endif //USE_WEBSERVER

if (!Settings->flag5.mi32_enable) { return false; } // SetOption115 - Enable ESP32 MI32 BLE

bool result = false;
Expand Down Expand Up @@ -2977,14 +2990,6 @@ bool Xsns62(uint32_t function)
case FUNC_WEB_SENSOR:
MI32Show(0);
break;
#ifdef USE_MI_EXT_GUI
case FUNC_WEB_ADD_MAIN_BUTTON:
if (Settings->flag5.mi32_enable) WSContentSend_P(HTTP_BTN_MENU_MI32);
break;
case FUNC_WEB_ADD_HANDLER:
WebServer_on(PSTR("/m32"), MI32HandleWebGUI);
break;
#endif //USE_MI_EXT_GUI
#endif // USE_WEBSERVER
}
return result;
Expand Down

0 comments on commit 17ab5a5

Please sign in to comment.