mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-29 05:36:39 +00:00
Refactor module logging
This commit is contained in:
parent
72e4d8f0d2
commit
129c26c695
@ -484,6 +484,8 @@ void StartWebserver(int type, IPAddress ipweb)
|
|||||||
#else
|
#else
|
||||||
AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_HTTP D_WEBSERVER_ACTIVE_ON " %s%s " D_WITH_IP_ADDRESS " %s"),
|
AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_HTTP D_WEBSERVER_ACTIVE_ON " %s%s " D_WITH_IP_ADDRESS " %s"),
|
||||||
NetworkHostname(), (Mdns.begun) ? PSTR(".local") : "", ipweb.toString().c_str());
|
NetworkHostname(), (Mdns.begun) ? PSTR(".local") : "", ipweb.toString().c_str());
|
||||||
|
// AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_HTTP D_WEBSERVER_ACTIVE_ON " %s%s " D_WITH_IP_ADDRESS " %_I"),
|
||||||
|
// NetworkHostname(), (Mdns.begun) ? PSTR(".local") : "", (uint32_t)ipweb);
|
||||||
#endif // LWIP_IPV6 = 1
|
#endif // LWIP_IPV6 = 1
|
||||||
TasmotaGlobal.rules_flag.http_init = 1;
|
TasmotaGlobal.rules_flag.http_init = 1;
|
||||||
}
|
}
|
||||||
@ -1587,12 +1589,12 @@ void ModuleSaveSettings(void)
|
|||||||
} else {
|
} else {
|
||||||
if (ValidGPIO(i, template_gp.io[i])) {
|
if (ValidGPIO(i, template_gp.io[i])) {
|
||||||
Settings.my_gp.io[i] = WebGetGpioArg(i);
|
Settings.my_gp.io[i] = WebGetGpioArg(i);
|
||||||
gpios += F(", "); gpios += String(i); gpios += F(" "); gpios += String(Settings.my_gp.io[i]);
|
gpios += F(", IO"); gpios += String(i); gpios += F(" "); gpios += String(Settings.my_gp.io[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_MODULE "%s " D_CMND_MODULE "%s"), ModuleName().c_str(), gpios.c_str());
|
AddLog_P(LOG_LEVEL_INFO, PSTR(D_LOG_MODULE "%s " D_CMND_MODULE "%s"), ModuleName().c_str(), gpios.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------------------------*/
|
||||||
|
@ -397,6 +397,25 @@ void DomoticzSensor(uint8_t idx, uint32_t value) {
|
|||||||
DomoticzSensor(idx, data);
|
DomoticzSensor(idx, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DomoticzFloatSensor(uint8_t idx, float value) {
|
||||||
|
uint32_t resolution = 1;
|
||||||
|
/*
|
||||||
|
switch (idx) {
|
||||||
|
case DZ_TEMP: resolution = Settings.flag2.temperature_resolution; break;
|
||||||
|
case DZ_POWER_ENERGY: resolution = Settings.flag2.wattage_resolution; break;
|
||||||
|
case DZ_VOLTAGE: resolution = Settings.flag2.voltage_resolution; break;
|
||||||
|
case DZ_CURRENT: resolution = Settings.flag2.current_resolution; break;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
if (DZ_TEMP == idx) { resolution = Settings.flag2.temperature_resolution; }
|
||||||
|
else if (DZ_POWER_ENERGY == idx) { resolution = Settings.flag2.wattage_resolution; }
|
||||||
|
else if (DZ_VOLTAGE == idx) { resolution = Settings.flag2.voltage_resolution; }
|
||||||
|
else if (DZ_CURRENT == idx) { resolution = Settings.flag2.current_resolution; }
|
||||||
|
char data[FLOATSZ];
|
||||||
|
dtostrfd(value, resolution, data);
|
||||||
|
DomoticzSensor(idx, data);
|
||||||
|
}
|
||||||
|
|
||||||
//void DomoticzTempHumPressureSensor(float temp, float hum, float baro = -1);
|
//void DomoticzTempHumPressureSensor(float temp, float hum, float baro = -1);
|
||||||
void DomoticzTempHumPressureSensor(float temp, float hum, float baro) {
|
void DomoticzTempHumPressureSensor(float temp, float hum, float baro) {
|
||||||
char temperature[FLOATSZ];
|
char temperature[FLOATSZ];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user