diff --git a/tasmota/tasmota_xdrv_driver/xdrv_49_pid.ino b/tasmota/tasmota_xdrv_driver/xdrv_49_pid.ino index 72b57dc95..2d8089289 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_49_pid.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_49_pid.ino @@ -454,6 +454,7 @@ void PIDShowValues(void) { ResponseAppend_P(PSTR("}")); } +#ifdef USE_WEBSERVER void PIDShowValuesWeb(void) { #define D_PID_DISPLAY_NAME "PID Controller" @@ -485,6 +486,7 @@ void PIDShowValuesWeb(void) { WSContentSend_PD(HTTP_PID_POWER_FORMAT, D_PID_POWER, 0, &f_buf); } } +#endif // USE_WEBSERVER void PIDRun(void) { double power = Pid.pid.tick(Pid.current_time_secs); @@ -537,9 +539,11 @@ bool Xdrv49(uint32_t function) { case FUNC_JSON_APPEND: PIDShowValues(); break; +#ifdef USE_WEBSERVER case FUNC_WEB_SENSOR: PIDShowValuesWeb(); break; +#endif // USE_WEBSERVER } return result; } diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino index 1c49d050e..498d80b15 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino @@ -708,7 +708,9 @@ extern "C" { if (top == 2 && be_isstring(vm, 2)) { const char *msg = be_tostring(vm, 2); be_pop(vm, top); // avoid Error be_top is non zero message +#ifdef USE_WEBSERVER WSContentSend_P(PSTR("%s"), msg); +#endif // USE_WEBSERVER be_return_nil(vm); // Return nil when something goes wrong } be_raise(vm, kTypeError, nullptr); @@ -721,7 +723,9 @@ extern "C" { if (top == 2 && be_isstring(vm, 2)) { const char *msg = be_tostring(vm, 2); be_pop(vm, top); // avoid Error be_top is non zero message +#ifdef USE_WEBSERVER WSContentSend_PD(PSTR("%s"), msg); +#endif // USE_WEBSERVER be_return_nil(vm); // Return nil when something goes wrong } be_raise(vm, kTypeError, nullptr); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_57_9_tasmesh.ino b/tasmota/tasmota_xdrv_driver/xdrv_57_9_tasmesh.ino index bfd52766d..6691017af 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_57_9_tasmesh.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_57_9_tasmesh.ino @@ -678,6 +678,7 @@ void MESHshow(bool json) { } } else { #ifdef ESP32 //web UI only on the the broker = ESP32 +#ifdef USE_WEBSERVER if (ROLE_BROKER == MESH.role) { // WSContentSend_PD(PSTR("TAS-MESH:
")); WSContentSend_PD(PSTR("Broker MAC %s
"), WiFi.softAPmacAddress().c_str()); @@ -718,6 +719,7 @@ void MESHshow(bool json) { idx++; } } +#endif // USE_WEBSERVER #endif // ESP32 } } diff --git a/tasmota/tasmota_xdrv_driver/xdrv_83_esp32_watch.ino b/tasmota/tasmota_xdrv_driver/xdrv_83_esp32_watch.ino index e318d2251..939fab4d9 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_83_esp32_watch.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_83_esp32_watch.ino @@ -237,11 +237,13 @@ void TTGO_WebShow(uint32_t json) { ResponseAppend_P(PSTR(",\"BMAX\":%d,\"BMAY\":%d,\"BMAZ\":%d"),acc.x,acc.y,acc.z); #endif ResponseJsonEnd(); +#ifdef USE_WEBSERVER } else { WSContentSend_PD(HTTP_TTGO,vstring,cstring,bvstring,bcstring,ttgo_adc.per,tstring); #ifdef USE_BMA423 WSContentSend_PD(HTTP_TTGO_BMA,acc.x,acc.y,acc.z); #endif // USE_BMA423 +#endif // USE_WEBSERVER } } diff --git a/tasmota/tasmota_xsns_sensor/xsns_29_mcp230xx.ino b/tasmota/tasmota_xsns_sensor/xsns_29_mcp230xx.ino index f158b79f6..29a25c182 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_29_mcp230xx.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_29_mcp230xx.ino @@ -167,7 +167,7 @@ uint8_t MCP230xx_readGPIO(uint8_t port) { void MCP230xx_ApplySettings(void) { #ifdef USE_MCP230xx_OUTPUT - TasmotaGlobal.devices_present -= mcp230xx_outpincount; + UpdateDevicesPresent(-mcp230xx_outpincount); mcp230xx_outpincount = 0; for (uint32_t idx = 0; idx < mcp230xx_pincount; idx++) { if (Settings->mcp230xx_config[idx].pinmode >= 5) { @@ -176,7 +176,7 @@ void MCP230xx_ApplySettings(void) } int_millis[idx]=millis(); } - TasmotaGlobal.devices_present += mcp230xx_outpincount; + UpdateDevicesPresent(mcp230xx_outpincount); #endif // USE_MCP230xx_OUTPUT uint8_t int_en = 0; uint8_t reg_portpins[mcp230xx_type]; @@ -793,6 +793,7 @@ bool MCP230xx_Command(void) return serviced; } +#ifdef USE_WEBSERVER #ifdef USE_MCP230xx_OUTPUT #ifdef USE_MCP230xx_DISPLAYOUTPUT @@ -815,8 +816,9 @@ void MCP230xx_UpdateWebData(void) } } -#endif // USE_MCP230xx_DISPLAYOUTPUT -#endif // USE_MCP230xx_OUTPUT +#endif // USE_MCP230xx_DISPLAYOUTPUT +#endif // USE_MCP230xx_OUTPUT +#endif // USE_WEBSERVER /* #ifdef USE_MCP230xx_OUTPUT diff --git a/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino b/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino index 1eaa924e1..bc3c6e5b5 100755 --- a/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino @@ -2375,9 +2375,11 @@ void SML_Show(boolean json) { tpowstr[i] = *mp++; } tpowstr[i] = 0; +#ifdef USE_WEBSERVER // export html //snprintf_P(b_mqtt_data, sizeof(b_mqtt_data), "%s{s}%s{e}", b_mqtt_data,tpowstr); WSContentSend_PD(PSTR("{s}%s{e}"), tpowstr); +#endif // USE_WEBSERVER // rewind, to ensure strchr mp--; mp = strchr(mp, '|'); @@ -2491,11 +2493,12 @@ void SML_Show(boolean json) { } } } - +#ifdef USE_WEBSERVER } else { // web ui export //snprintf_P(b_mqtt_data, sizeof(b_mqtt_data), "%s{s}%s %s: {m}%s %s{e}", b_mqtt_data,meter_desc[mindex].prefix,name,tpowstr,unit); if (strcmp(name, "*")) WSContentSend_PD(PSTR("{s}%s %s {m}%s %s{e}"), sml_globs.mp[mindex].prefix, name,tpowstr, unit); +#endif // USE_WEBSERVER } } } @@ -2512,8 +2515,10 @@ void SML_Show(boolean json) { if (!nojson) { ResponseAppend_P(PSTR("}")); } +#ifdef USE_WEBSERVER } else { //WSContentSend_PD(PSTR("%s"),b_mqtt_data); +#endif // USE_WEBSERVER } diff --git a/tasmota/tasmota_xsns_sensor/xsns_78_ezohum.ino b/tasmota/tasmota_xsns_sensor/xsns_78_ezohum.ino index a992dd0ff..824fcae8d 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_78_ezohum.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_78_ezohum.ino @@ -43,10 +43,12 @@ struct EZOHUM : public EZOStruct { virtual void Show(bool json, const char *name) { if (isnan(temperature)) { +#ifdef USE_WEBSERVER char parameter[FLOATSZ]; dtostrfd(humidity, Settings->flag2.humidity_resolution, parameter); WSContentSend_PD(HTTP_SNS_HUM, name, parameter); +#endif // USE_WEBSERVER } else { TempHumDewShow(json, (0 == TasmotaGlobal.tele_period), name, temperature, humidity); } diff --git a/tasmota/tasmota_xsns_sensor/xsns_85_mpu6886.ino b/tasmota/tasmota_xsns_sensor/xsns_85_mpu6886.ino index a3c64b360..a0b94a654 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_85_mpu6886.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_85_mpu6886.ino @@ -60,6 +60,7 @@ void MPU_Show(uint32_t json) { mpu_sensor.mpu_model, mpu_sensor.ax, mpu_sensor.ay, mpu_sensor.az, mpu_sensor.gyx, mpu_sensor.gyy, mpu_sensor.gyz); +#ifdef USE_WEBSERVER } else { float ax = mpu_sensor.ax / 1000.0f; float ay = mpu_sensor.ay / 1000.0f; @@ -67,6 +68,7 @@ void MPU_Show(uint32_t json) { WSContentSend_PD(HTTP_MPU6686, mpu_sensor.mpu_model, &ax, mpu_sensor.mpu_model, &ay, mpu_sensor.mpu_model, &az, mpu_sensor.mpu_model, mpu_sensor.gyx, mpu_sensor.mpu_model, mpu_sensor.gyy, mpu_sensor.mpu_model, mpu_sensor.gyz); +#endif // USE_WEBSERVER } }