Moved wifi depending code to separate function.

This commit is contained in:
Kai Lauterbach 2022-09-20 08:21:24 +02:00
parent 1f2b4ec38c
commit 17fdbe6155
1 changed files with 18 additions and 9 deletions

View File

@ -94,18 +94,10 @@ void setup()
wifiConnect(); wifiConnect();
debug("Connected!"); debug("Connected!");
#ifdef INFLUXDB_FEATURE initWifiBasedSW();
influxdb_begin();
#endif
initSensors(); initSensors();
#ifdef WEBUPDATER_FEATURE
#ifndef BATTERY_POWERED
setupWebUpdater(DEVICE_NAME, WiFi.localIP().toString());
#endif
#endif
//It's magic! leave in //It's magic! leave in
delay(100); delay(100);
@ -140,6 +132,23 @@ void setup()
//*************************************************************************// //*************************************************************************//
void initWifiBasedSW()
{
#ifdef INFLUXDB_FEATURE
influxdb_begin();
#endif
#ifdef WEBUPDATER_FEATURE
#ifndef BATTERY_POWERED
setupWebUpdater(DEVICE_NAME, WiFi.localIP().toString());
#endif
#endif
}
//*************************************************************************//
void initSensors() void initSensors()
{ {
// Initialize and configure the sensors // Initialize and configure the sensors