diff --git a/lighthub/item.cpp b/lighthub/item.cpp index 3cf51f5..8e6859c 100644 --- a/lighthub/item.cpp +++ b/lighthub/item.cpp @@ -81,20 +81,10 @@ void Item::Parse() { for (int i = aJson.getArraySize(itemArr); i < 4; i++) aJson.addItemToArray(itemArr, aJson.createItem( int(defval[i]))); //Enlarge item to 4 elements. VAL=int if no other definition in conf - - itemType = aJson.getArrayItem(itemArr, I_TYPE)->valueint; itemArg = aJson.getArrayItem(itemArr, I_ARG); itemVal = aJson.getArrayItem(itemArr, I_VAL); - -/* - Serial.print(F(" Item:")); - Serial.print(itemArr->name); - Serial.print(F(" T:")); - Serial.print(itemType); - Serial.print(F(" =")); - Serial.println(getArg()); - */ + debugSerial << (F(" Item:") << itemArr->name << F(" T:") << itemType << F(" =") << getArg() << eol; } } @@ -117,13 +107,12 @@ uint8_t Item::getCmd(bool ext) { } -void Item::setCmd(uint8_t cmd) { - aJsonObject *t = aJson.getArrayItem(itemArr, I_CMD); - if (t) +void Item::setCmd(uint8_t cmdValue) { + aJsonObject *itemCmd = aJson.getArrayItem(itemArr, I_CMD); + if (itemCmd) { - t->valueint = cmd; - Serial.print(F("SetCmd:")); - Serial.println(cmd); + itemCmd->valueint = cmdValue; + debugSerial<type != aJson_Int) return; - // Serial.print(F(" Store ")); - // Serial.print(F(" Val=")); - // Serial.println(par); + debugSerial<")); - Serial.println(valstr); + debugSerial<")<