mirror of
https://github.com/anklimov/lighthub
synced 2025-12-06 11:49:51 +03:00
few cleanup
This commit is contained in:
@@ -311,7 +311,7 @@ if (isSet)
|
|||||||
|
|
||||||
int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int subItemN) {
|
int Item::Ctrl(short cmd, short n, int *Parameters, boolean send, int subItemN) {
|
||||||
|
|
||||||
debugSerial<<F(" MEM=")<<freeRam()<<F(" Item=")<<itemArr->name<<F(" Sub=")<<subItemN<<F(" Cmd=")<<cmd<<F(" Par= ");
|
debugSerial<<F("RAM=")<<freeRam()<<F(" Item=")<<itemArr->name<<F(" Sub=")<<subItemN<<F(" Cmd=")<<cmd<<F(" Par= ");
|
||||||
if (!itemArr) return -1;
|
if (!itemArr) return -1;
|
||||||
int Par[MAXCTRLPAR] = {0, 0, 0};
|
int Par[MAXCTRLPAR] = {0, 0, 0};
|
||||||
if (Parameters)
|
if (Parameters)
|
||||||
|
|||||||
@@ -1170,13 +1170,10 @@ lan_status loadConfigFromHttp(int arg_cnt, char **args)
|
|||||||
|
|
||||||
#if defined(ARDUINO_ARCH_AVR)
|
#if defined(ARDUINO_ARCH_AVR)
|
||||||
FILE *configStream;
|
FILE *configStream;
|
||||||
//byte hserver[] = { 192,168,88,2 };
|
|
||||||
wdt_dis();
|
wdt_dis();
|
||||||
HTTPClient hclient(configServer, 80);
|
HTTPClient hclient(configServer, 80);
|
||||||
//HTTPClient hclientPrint(configServer, 80);
|
|
||||||
// FILE is the return STREAM type of the HTTPClient
|
// FILE is the return STREAM type of the HTTPClient
|
||||||
configStream = hclient.getURI(URI);
|
configStream = hclient.getURI(URI);
|
||||||
//Serial.println("got--");delay(500);
|
|
||||||
responseStatusCode = hclient.getLastReturnCode();
|
responseStatusCode = hclient.getLastReturnCode();
|
||||||
wdt_en();
|
wdt_en();
|
||||||
|
|
||||||
@@ -1190,7 +1187,6 @@ lan_status loadConfigFromHttp(int arg_cnt, char **args)
|
|||||||
cleanConf();
|
cleanConf();
|
||||||
root = aJson.parse(&as);
|
root = aJson.parse(&as);
|
||||||
interrupts();
|
interrupts();
|
||||||
// debugSerial<<F("Parsed."));
|
|
||||||
hclient.closeStream(configStream); // this is very important -- be sure to close the STREAM
|
hclient.closeStream(configStream); // this is very important -- be sure to close the STREAM
|
||||||
|
|
||||||
if (!root) {
|
if (!root) {
|
||||||
@@ -1198,9 +1194,6 @@ lan_status loadConfigFromHttp(int arg_cnt, char **args)
|
|||||||
nextLanCheckTime = millis() + 15000;
|
nextLanCheckTime = millis() + 15000;
|
||||||
return READ_RE_CONFIG;//-11;
|
return READ_RE_CONFIG;//-11;
|
||||||
} else {
|
} else {
|
||||||
// char *outstr = aJson.print(root);
|
|
||||||
// debugSerial<<outstr);
|
|
||||||
// free(outstr);
|
|
||||||
debugSerial<<F("Applying.\n");
|
debugSerial<<F("Applying.\n");
|
||||||
applyConfig();
|
applyConfig();
|
||||||
debugSerial<<F("Done.\n");
|
debugSerial<<F("Done.\n");
|
||||||
@@ -1764,7 +1757,7 @@ void thermoLoop(void) {
|
|||||||
nextThermostatCheck = millis() + THERMOSTAT_CHECK_PERIOD;
|
nextThermostatCheck = millis() + THERMOSTAT_CHECK_PERIOD;
|
||||||
publishStat();
|
publishStat();
|
||||||
#ifndef DISABLE_FREERAM_PRINT
|
#ifndef DISABLE_FREERAM_PRINT
|
||||||
(thermostatCheckPrinted) ? debugSerial<<F("\nfree:")<<freeRam()<<" " : debugSerial<<F(" ")<<freeRam()<<F(" ");
|
(thermostatCheckPrinted) ? debugSerial<<F("\nRAM=")<<freeRam()<<" " : debugSerial<<F(" ")<<freeRam()<<F(" ");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user