Some code refactoring

This commit is contained in:
Theo Arends 2020-06-02 12:09:31 +02:00
parent eb5ebfbf0f
commit e57bbb2b7d
3 changed files with 6 additions and 6 deletions

View File

@ -89,7 +89,7 @@ void LM75ADShow(bool json)
dtostrfd(t, Settings.flag2.temperature_resolution, temperature); dtostrfd(t, Settings.flag2.temperature_resolution, temperature);
if (json) { if (json) {
ResponseAppend_P(PSTR(",\"LM75AD\":{\"" D_JSON_TEMPERATURE "\":%s}"), temperature); ResponseAppend_P(JSON_SNS_TEMP, "LM75AD", temperature);
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
if (0 == tele_period) DomoticzSensor(DZ_TEMP, temperature); if (0 == tele_period) DomoticzSensor(DZ_TEMP, temperature);
#endif // USE_DOMOTICZ #endif // USE_DOMOTICZ

View File

@ -184,7 +184,7 @@ void DS1624Show(bool json)
dtostrfd(ds1624_sns[i].value, Settings.flag2.temperature_resolution, temperature); dtostrfd(ds1624_sns[i].value, Settings.flag2.temperature_resolution, temperature);
if (json) { if (json) {
ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_TEMPERATURE "\":%s}"), ds1624_sns[i].name, temperature); ResponseAppend_P(JSON_SNS_TEMP, ds1624_sns[i].name, temperature);
if ((0 == tele_period) && once) { if ((0 == tele_period) && once) {
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
DomoticzSensor(DZ_TEMP, temperature); DomoticzSensor(DZ_TEMP, temperature);

View File

@ -85,7 +85,7 @@ void MCP9808Show(bool json) {
} }
if (json) { if (json) {
ResponseAppend_P(PSTR(",\"%s\":{\"" D_JSON_TEMPERATURE "\":%s}"), sensor_name, temperature); ResponseAppend_P(JSON_SNS_TEMP, sensor_name, temperature);
if ((0 == tele_period) && (0 == i)) { if ((0 == tele_period) && (0 == i)) {
#ifdef USE_DOMOTICZ #ifdef USE_DOMOTICZ
DomoticzSensor(DZ_TEMP, temperature); DomoticzSensor(DZ_TEMP, temperature);