diff --git a/lighthub/abstractout.h b/lighthub/abstractout.h index c1279db..41417a8 100644 --- a/lighthub/abstractout.h +++ b/lighthub/abstractout.h @@ -8,7 +8,7 @@ class chPersistent {}; class abstractOut : public abstractCh{ public: abstractOut(Item * _item):abstractCh(){item=_item;}; - virtual int Ctrl(itemCmd cmd, char* subItem=NULL) =0; + virtual int Ctrl(itemCmd cmd, char* subItem=NULL, bool toExecute=true) =0; virtual int isActive(){return 0;}; virtual int getDefaultOnVal(){return 100;}; virtual int getChanType(){return 0;} diff --git a/lighthub/colorchannel.cpp b/lighthub/colorchannel.cpp index 312f685..6ef5278 100644 --- a/lighthub/colorchannel.cpp +++ b/lighthub/colorchannel.cpp @@ -16,16 +16,30 @@ short colorChannel::getChannelAddr(short n) return item->getArg(n); } -int colorChannel::Ctrl(itemCmd cmd, char* subItem) +int colorChannel::Ctrl(itemCmd cmd, char* subItem, bool toExecute) { - -int chActive = item->isActive(); -bool toExecute = (chActive>0); // execute if channel is active now +debugSerial<isActive(); +//bool toExecute = (chActive>0); // execute if channel is active now int suffixCode = cmd.getSuffix(); -itemCmd st(ST_HSV,CMD_VOID); +/* +// Since this driver working both, for single-dimmed or PWM channel and color - define storage type +uint8_t storageType; +switch (getChanType()) +{ + case CH_RGB: + case CH_RGBW: + storageType=ST_HSV; + break; + default: + storageType=ST_PERCENTS; +} +itemCmd st(storageType,CMD_VOID); if (!suffixCode) toExecute=true; //forced execute if no suffix if (cmd.isCommand() && !suffixCode) suffixCode=S_CMD; //if some known command recognized , but w/o correct cmd suffix - threat it as command +*/ switch(suffixCode) { @@ -34,62 +48,32 @@ case S_NOTFOUND: toExecute = true; case S_SET: case S_HSV: - st.loadItem(item); - st.assignFrom(cmd); - PixelCtrl(st, subItem, toExecute); - st.saveItem(item); - - if (!suffixCode) - { - if (chActive>0 && !st.getPercents()) item->setCmd(CMD_OFF); - if (chActive==0 && st.getPercents()) item->setCmd(CMD_ON); - item->SendStatus(SEND_COMMAND | SEND_PARAMETERS | SEND_DEFFERED); - } - else item->SendStatus(SEND_PARAMETERS | SEND_DEFFERED); + PixelCtrl(cmd, subItem, toExecute); return 1; -/* -case S_HUE: - st.setH(uint16_t); - break; - -case S_SAT: - st.setS(uint8_t); - break; -*/ case S_CMD: item->setCmd(cmd.getCmd()); switch (cmd.getCmd()) { case CMD_ON: - //retrive stored values - if (st.loadItem(item)) - { - if (st.param.aslong && (st.param.vSendStatus(SEND_COMMAND | SEND_PARAMETERS ); return 1; case CMD_OFF: - st.Percents(0); - PixelCtrl(st, subItem, true); + cmd.Percents(0); + PixelCtrl(cmd, subItem, true); item->SendStatus(SEND_COMMAND); return 1; + + default: + debugSerial<getArgCount(); // and how many addresses is configured }; - int Ctrl(itemCmd cmd, char* subItem=NULL) override; + int Ctrl(itemCmd cmd, char* subItem=NULL, bool toExecute=true) override; virtual int PixelCtrl(itemCmd cmd, char* subItem=NULL, bool show=true ) =0; short getChannelAddr(short n =0); protected: diff --git a/lighthub/inputs.cpp b/lighthub/inputs.cpp index cc43cd6..6893ccb 100644 --- a/lighthub/inputs.cpp +++ b/lighthub/inputs.cpp @@ -23,7 +23,7 @@ e-mail anklimov@gmail.com #include "utils.h" #include #include "main.h" -#include "itemCmd.h"" +#include "itemCmd.h" #ifndef DHT_DISABLE #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) diff --git a/lighthub/item.cpp b/lighthub/item.cpp index 4496aef..0de8219 100644 --- a/lighthub/item.cpp +++ b/lighthub/item.cpp @@ -354,7 +354,7 @@ void Item::setSubtype(uint8_t par) // Only store if VAL is int (autogenerated o { if (!itemVal || itemVal->type != aJson_Int) return; //debugSerial<Ctrl(cmd.Cmd(CMD_ON), subItem); + res = driver->Ctrl(st.Cmd(CMD_ON), subItem); setCmd(CMD_XON); + SendStatus(SEND_COMMAND); } else { //cmd = CMD_ON; @@ -683,8 +733,9 @@ if (driver) //New style modular code case CMD_HALT: if (chActive>0) //if channel was active before CMD_HALT { - res = driver->Ctrl(cmd.Cmd(CMD_OFF), subItem); + res = driver->Ctrl(st.Cmd(CMD_OFF), subItem); setCmd(CMD_HALT); + SendStatus(SEND_COMMAND); return res; } else @@ -696,8 +747,9 @@ if (driver) //New style modular code case CMD_OFF: if (getCmd() != CMD_HALT) //Halted, ignore OFF { - res = driver->Ctrl(cmd.Cmd(CMD_OFF), subItem); + res = driver->Ctrl(st.Cmd(CMD_OFF), subItem); setCmd(CMD_OFF); + SendStatus(SEND_COMMAND); } else { @@ -707,41 +759,48 @@ if (driver) //New style modular code break; case CMD_VOID: - res = driver->Ctrl(st, subItem); + res = driver->Ctrl(st, subItem, toExecute); break; default: //another command - res = driver->Ctrl(cmd, subItem); - if (cmd.isCommand()) setCmd(cmd.getCmd()); + res = driver->Ctrl(st, subItem); + if (st.isCommand()) + { + setCmd(st.getCmd()); + SendStatus(SEND_COMMAND); + } } return res; } - +else //Driver not found //================== +{ switch (itemType) { - case CH_GROUP://Group - { - if (itemArg->type == aJson_Array) { - aJsonObject *i = itemArg->child; - configLocked++; - while (i) { - if (i->type == aJson_String) - { - Item it(i->valuestring); - it.Ctrl(cmd,subItem); - } - i = i->next; - } //while - configLocked--; - } //if - } //case + case CH_GROUP: + { + if (itemArg->type == aJson_Array) { + aJsonObject *i = itemArg->child; + configLocked++; + while (i) { + if (i->type == aJson_String) + { + Item it(i->valuestring); + it.Ctrl(cmd,subItem); + } + i = i->next; + } //while + configLocked--; + } //if + } //case + break; + + // rest of Legacy monolite core code (to be refactored ) - case CH_RELAY: - { + { short iaddr=getArg(); - short icmd =cmd.getCmd(); + short icmd =st.getCmd(); if (iaddr) { @@ -752,704 +811,47 @@ switch (itemType) { iaddr = -iaddr; inverse = 1; } - pinMode(iaddr, OUTPUT); + if (iaddr <=PINS_COUNT && iaddr>0) + { + pinMode(iaddr, OUTPUT); - if (inverse) - digitalWrite(iaddr, k = ((icmd == CMD_ON || icmd == CMD_XON) ? LOW : HIGH)); - else - digitalWrite(iaddr, k = ((icmd == CMD_ON || icmd == CMD_XON) ? HIGH : LOW)); - debugSerial<"); - } - debugSerial<0) cmd = CMD_OFF; - else cmd = CMD_ON; - break; - - case CMD_RESTORE: - if (itemType != CH_GROUP) //individual threating of channels. Ignore restore command for groups - switch (t = getCmd()) { - case CMD_HALT: //previous command was HALT ? - debugSerial << F("Restored from:") << t << endl; - if (itemType == CH_THERMO) cmd = CMD_AUTO; - else cmd = CMD_ON; //turning on - break; - default: - return -3; - } - break; - case CMD_XOFF: - if (itemType != CH_GROUP) //individual threating of channels. Ignore restore command for groups - switch (t = getCmd()) { - case CMD_XON: //previous command was CMD_XON ? - debugSerial << F("Turned off from:") << t << endl; - cmd = CMD_OFF; //turning Off - break; - default: - debugSerial<Ctrl(CMD_ON, n, Par, suffixCode, subItem); - res = driver->Ctrl(_itemCmd.Cmd(CMD_ON), subItem); - setCmd(CMD_XON); - } - else - { //cmd = CMD_ON; - debugSerial<0) //if channel was active before CMD_HALT - { - res = driver->Ctrl(_itemCmd.Cmd(CMD_OFF), subItem); - setCmd(CMD_HALT); - return res; - } - else - { - debugSerial<Ctrl(_itemCmd, subItem); - setCmd(CMD_OFF); - } - else - { - debugSerial<Ctrl(cmd, n, Parameters, send, suffixCode, subItem); - //break; - // - default: - res = driver->Ctrl(_itemCmd, subItem); - if (cmd) setCmd(cmd); - } - return res; - } - // Legacy monolite core code - bool toExecute = (chActive>0); //if channel is already active - unconditionally propogate changes - - switch (cmd) { - case 0: // No command - set params - - if (!suffixCode) toExecute= true; - if (suffixCode == S_HUE || suffixCode == S_SAT) break; - switch (itemType) { - - case CH_RGBW: //only if configured VAL array - if (!Par[1] && (n == 3)) itemType = CH_WHITE; - case CH_RGB: - case CH_GROUP: //Save for groups as well - st.aslong = getVal(); - switch (n) - { - case 1: - - st.v = Par[0]; //Volume only - if (getSubtype()==ST_HSV || getSubtype()==ST_RGB) - { - Par[0] = st.h; - Par[1] = st.s; - Par[2] = st.v; - n = 3;} - break; - case 2: // Just hue and saturation - st.h = Par[0]; - st.s = Par[1]; - Par[2] = st.v; - //st.hsv_flag = 1; - setSubtype(ST_HSV); - n = 3; - break; - case 3: //complete triplet - st.h = Par[0]; - st.s = Par[1]; - st.v = Par[2]; - //st.hsv_flag = 1; - setSubtype(ST_HSV); - } - setVal(st.aslong); - if (!suffixCode) - { // - if (chActive>0 && !st.v) - { - setCmd(CMD_OFF); - SendStatus(SEND_COMMAND | SEND_PARAMETERS | SEND_DEFFERED); - } - else if (chActive==0 && st.v) - { - setCmd(CMD_ON); - SendStatus(SEND_COMMAND | SEND_PARAMETERS | SEND_DEFFERED); - } - //// else setCmd(0); - SendStatus(SEND_PARAMETERS | SEND_DEFFERED); - } - else - { - //// setCmd(0); - SendStatus(SEND_PARAMETERS | SEND_DEFFERED); - } - break; - case CH_PWM: - case CH_VC: - case CH_DIMMER: - case CH_MODBUS: - setVal(Par[0]); // Store value -// setCmd(cmd2changeActivity(chActive,cmd)); - if (!suffixCode) - { // Not restoring, working - if (chActive>0 && !Par[0]) setCmd(CMD_OFF); - if (chActive==0 && Par[0]) setCmd(CMD_ON); - SendStatus(SEND_COMMAND | SEND_PARAMETERS | SEND_DEFFERED); // Send back parameter for channel above this line - } - else SendStatus(SEND_PARAMETERS | SEND_DEFFERED); - break; - - case CH_VCTEMP: // moved - case CH_THERMO: ///? wasnt send before/ now will /// - setVal(Par[0]); // Store value - if (send) SendStatus(SEND_PARAMETERS | SEND_DEFFERED); // Send back parameter for channel above this line - }//itemtype - - if (! toExecute && itemType !=CH_GROUP) return 1; // Parameters are stored, no further action required - break; - - case CMD_XON: - if (!chActive>0) //if channel was'nt active before CMD_XON - { - debugSerial<0 && send) - { - SendStatus(SEND_COMMAND); - return 1; - } - { - short params = 0; - //retrive stored values - st.aslong = getVal(); - - // If command is ON but saved volume to low - setup mimimum volume - switch (itemType) { - case CH_DIMMER: - case CH_MODBUS: - if (st.aslong0) - // DmxWrite(iaddr, map(Par[0], 0, 100, 0, 255)); - DmxWrite(iaddr, getBright(Par[0])); - break; - case CH_RGBW: //Colour RGBW - // Saturation 0 - Only white - // 0..50 - white + RGB - //50..100 RGB - { - // int k; - if (Par[1]<50 && iaddr>0) { // Using white - DmxWrite(iaddr + 3, getBright255(map((50 - Par[1]) * Par[2], 0, 5000, 0, 255))); - int rgbvLevel = map (Par[1],0,50,0,255*2); - rgbValue = map(getBright(Par[2]), 0, 255, 0, rgbvLevel); - rgbSaturation = map(Par[1], 0, 50, 255, 100); - if (rgbValue>255) rgbValue = 255; - } - else - { - //rgbValue = map(Par[2], 0, 100, 0, 255); - rgbSaturation = map(Par[1], 50, 100, 100, 255); - if (iaddr>0) DmxWrite(iaddr + 3, 0); - } - //DmxWrite(iaddr + 3, k = map((100 - Par[1]) * Par[2], 0, 10000, 0, 255)); - //debugSerial<0) - { - #ifdef ADAFRUIT_LED - Adafruit_NeoPixel strip(0, 0, 0); - uint32_t rgb = strip.ColorHSV(map(Par[0], 0, 365, 0, 65535), rgbSaturation, rgbValue); - DmxWrite(iaddr, (rgb >> 16)& 0xFF); - DmxWrite(iaddr + 1, (rgb >> 8) & 0xFF); - DmxWrite(iaddr + 2, rgb & 0xFF); - #else - CRGB rgb = CHSV(map(Par[0], 0, 365, 0, 255), rgbSaturation, rgbValue); - DmxWrite(iaddr, rgb.r); - DmxWrite(iaddr + 1, rgb.g); - DmxWrite(iaddr + 2, rgb.b); - #endif - break; - } - case CH_WHITE: - if (iaddr>0) - { - DmxWrite(iaddr, 0); - DmxWrite(iaddr + 1, 0); - DmxWrite(iaddr + 2, 0); - // DmxWrite(iaddr + 3, map(Par[2], 0, 100, 0, 255)); - DmxWrite(iaddr + 3,rgbValue); - break; - } -#endif - -#ifndef MODBUS_DISABLE - case CH_MODBUS: - modbusDimmerSet(Par[0]); - break; -#endif - - - case CH_GROUP://Group - { - if (itemArg->type == aJson_Array) { - aJsonObject *i = itemArg->child; - configLocked++; - while (i) { - if (i->type == aJson_String) - { - Item it(i->valuestring); - it.Ctrl(cmd, n, Par, suffixCode,subItem); //// was true - } - i = i->next; - } //while - configLocked--; - } //if - } //case - break; - case CH_RELAY: - if (iaddr) - { - int k; - short inverse = 0; - - if (iaddr < 0) { - iaddr = -iaddr; - inverse = 1; - } - pinMode(iaddr, OUTPUT); - - if (inverse) - digitalWrite(iaddr, k = ((cmd == CMD_ON || cmd == CMD_XON) ? LOW : HIGH)); - else - digitalWrite(iaddr, k = ((cmd == CMD_ON || cmd == CMD_XON) ? HIGH : LOW)); - debugSerial< PWM frequency is 31000 Hz - //prescaler = 2 ---> PWM frequency is 4000 Hz - //prescaler = 3 ---> PWM frequency is 490 Hz (default value) - //prescaler = 4 ---> PWM frequency is 120 Hz - //prescaler = 5 ---> PWM frequency is 30 Hz - //prescaler = 6 ---> PWM frequency is <20 Hz -#if defined(__AVR_ATmega2560__) - int tval = 7; // this is 111 in binary and is used as an eraser - TCCR4B &= ~tval; // this operation (AND plus NOT), set the three bits in TCCR2B to 0 - TCCR3B &= ~tval; - tval = 2; - TCCR4B |= tval; - TCCR3B |= tval; -#endif - if (inverse) k = map(Par[0], 100, 0, 0, 255); - else k = map(Par[0], 0, 100, 0, 255); - analogWrite(iaddr, k); - debugSerial<valuestring); -// if (it.isValid() && it.itemType == CH_VC) - VacomSetHeat(Par[0], cmd); - break; - } -#endif - } -return 1; -} - - -*/ @@ -2053,7 +1455,7 @@ switch (cause) void Item::sendDelayedStatus() { long int flags = getFlag(SEND_COMMAND | SEND_PARAMETERS); -// debugSerial<name<getChanType(); @@ -2103,7 +1507,15 @@ int Item::SendStatus(int sendFlags) { default: snprintf(valstr, sizeof(valstr), "%ld", st.aslong); }//itemtype - } + */ + + + + + itemCmd st(ST_VOID,CMD_VOID); + st.loadItem(this, true); + st.toString(valstr, sizeof(valstr), SEND_PARAMETERS); + } if (sendFlags & SEND_COMMAND) { // Preparing Command payload ////////////// diff --git a/lighthub/itemCmd.cpp b/lighthub/itemCmd.cpp index b26ae93..df3dc21 100644 --- a/lighthub/itemCmd.cpp +++ b/lighthub/itemCmd.cpp @@ -39,17 +39,48 @@ int txt2cmd(char *payload) { itemCmd::itemCmd(uint8_t _type, uint8_t _code) { + cmd.aslong=0; + param.aslong=0; + cmd.itemArgType=_type; cmd.cmdCode=_code; } itemCmd::itemCmd(float val) { - cmd.cmdCode=0; + cmd.aslong=0; + param.aslong=0; + cmd.itemArgType=ST_FLOAT; param.asfloat=val; } +itemCmd itemCmd::setChanType(short chanType) +{ + switch (chanType) + { + case CH_RGB: + case CH_RGBW: + case CH_SPILED: + cmd.itemArgType=ST_HSV; + break; + case CH_AC: + case CH_THERMO: + case CH_VCTEMP: + cmd.itemArgType=ST_FLOAT_CELSIUS; + break; + case CH_DIMMER: + case CH_MOTOR: + case CH_PWM: + case CH_RELAY: + cmd.itemArgType=ST_PERCENTS; + break; + default: + cmd.itemArgType=ST_PERCENTS; + } + return *this; +} + itemCmd itemCmd::setDefault() { switch (cmd.itemArgType){ @@ -71,7 +102,7 @@ itemCmd itemCmd::setDefault() return *this; } -itemCmd itemCmd::setH(uint16_t h) +bool itemCmd::setH(uint16_t h) { int par=h; switch (cmd.itemArgType) @@ -79,16 +110,20 @@ itemCmd itemCmd::setH(uint16_t h) case ST_VOID: cmd.itemArgType=ST_HSV; case ST_HSV: - if (par>100) par=100; case ST_HSV255: - if (par>255) par=255; + if (par>365) par=365; if (par<0) par=0; param.h=par; + break; + + default: + // debugSerial<100) par=100; + param.s=par; + break; case ST_HSV255: if (par>255) par=255; if (par<0) par=0; param.s=par; + break; + default: +// debugSerial<255) par=255; if (par<0) par=0; break; + default: return false; } param.v=par; - return *this; + return true; } -itemCmd itemCmd::incrementH(int16_t dif) +bool itemCmd::incrementH(int16_t dif) { int par=param.h; switch (cmd.itemArgType) { @@ -135,31 +187,34 @@ itemCmd itemCmd::incrementH(int16_t dif) par+=dif; if (par>365) par=0; if (par<0) par=365; + break; + default: return false; break; } param.h=par; -return *this; +return true; } -itemCmd itemCmd::incrementS(int16_t dif) +bool itemCmd::incrementS(int16_t dif) {int par=param.s; switch (cmd.itemArgType) { - case ST_PERCENTS: + //case ST_PERCENTS: case ST_HSV: par+=dif; if (par>100) par=100; if (par<0) par=0; break; - case ST_PERCENTS255: + //case ST_PERCENTS255: case ST_HSV255: par+=dif; if (par>255) par=255; if (par<0) par=0; break; + default: return false; } param.s=par; - return *this; + return true; } @@ -168,6 +223,7 @@ itemCmd itemCmd::assignFrom(itemCmd from) { bool RGBW_flag = false; bool HSV255_flag = false; + cmd.suffixCode=from.cmd.suffixCode; switch (cmd.itemArgType){ //Destination case ST_HSV: @@ -201,6 +257,7 @@ itemCmd itemCmd::assignFrom(itemCmd from) default: debugSerial<")<")<")<isValid()) { - param.asInt32=item->getVal(); - cmd.itemArgType=item->getSubtype(); - if (includeCommand) cmd.cmdCode=item->getCmd(); - return (cmd.itemArgType!=ST_VOID); + short subtype =item->getSubtype(); + if (subtype) + { + param.asInt32=item->getVal(); + cmd.itemArgType= subtype; + if (includeCommand) cmd.cmdCode=item->getCmd(); + debugSerial<setVal(param.asInt32); item->setSubtype(cmd.itemArgType); if (includeCommand) item->setCmd(cmd.cmdCode); + debugSerial<isActive(); -bool toExecute = (chActive>0); -itemCmd st(ST_UINT32,CMD_VOID); +//int chActive = item->isActive(); +//bool toExecute = (chActive>0); +//itemCmd st(ST_UINT32,CMD_VOID); int suffixCode = cmd.getSuffix(); if (cmd.isCommand() && !suffixCode) suffixCode=S_CMD; //if some known command find, but w/o correct suffix - got it @@ -355,58 +355,30 @@ toExecute = true; debugSerial<setVal(st=Parameters[0]); //Store - if (!suffixCode) - { - if (chActive>0 && !st.getInt()) item->setCmd(CMD_OFF); - if (chActive==0 && st.getInt()) item->setCmd(CMD_ON); - item->SendStatus(SEND_COMMAND | SEND_PARAMETERS | SEND_DEFFERED); -// if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time - } - else item->SendStatus(SEND_PARAMETERS | SEND_DEFFERED); +//TODO return 1; //break; case S_CMD: - //item->setCmd(cmd.getCmd()); - st.loadItem(item); switch (cmd.getCmd()) { case CMD_ON: - //retrive stored values - st.loadItem(item); - - if (st.getPercents() && (st.getPercents()SendStatus(SEND_COMMAND | SEND_PARAMETERS); - debugSerial<SendStatus(SEND_COMMAND | SEND_PARAMETERS ); - } - // if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time return 1; case CMD_OFF: - item->SendStatus(SEND_COMMAND); - // if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time + return 1; -} //switch cmd + default: + debugSerial<isActive(); -bool toExecute = (chActive>0); +//int chActive = item->isActive(); +//bool toExecute = (chActive>0); int suffixCode = cmd.getSuffix(); -itemCmd st(ST_PERCENTS,CMD_VOID); +//itemCmd st(ST_PERCENTS,CMD_VOID); if (cmd.isCommand() && !suffixCode) suffixCode=S_CMD; //if some known command find, but w/o correct suffix - got it item->setFlag(ACTION_NEEDED); @@ -229,6 +229,8 @@ toExecute = true; debugSerial<getExt()) item->setExt(millis()+maxOnTime); //Extend motor time + /* st.assignFrom(cmd); //Store st.saveItem(item); @@ -240,7 +242,7 @@ case S_SET: if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time } else item->SendStatus(SEND_PARAMETERS | SEND_DEFFERED); - + */ return 1; //break; @@ -249,10 +251,12 @@ case S_CMD: switch (cmd.getCmd()) { case CMD_ON: + + /* //retrive stored values if (st.loadItem(item)) { - if (st.getPercents() && (st.getPercents()setVal(st); item->SendStatus(SEND_COMMAND | SEND_PARAMETERS ); } - + */ if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time return 1; case CMD_OFF: - item->SendStatus(SEND_COMMAND); + ////item->SendStatus(SEND_COMMAND); if (item->getExt()) item->setExt(millis()+maxOnTime); //Extend motor time return 1; diff --git a/lighthub/modules/out_motor.h b/lighthub/modules/out_motor.h index e9ab984..398b375 100644 --- a/lighthub/modules/out_motor.h +++ b/lighthub/modules/out_motor.h @@ -26,7 +26,7 @@ public: int isActive() override; int getChanType() override; //int Ctrl(short cmd, short n=0, int * Parameters=NULL, int suffixCode=0, char* subItem=NULL) override; - int Ctrl(itemCmd cmd, char* subItem=NULL) override; + int Ctrl(itemCmd cmd, char* subItem=NULL, bool toExecute=true) override; int8_t pinUp; int8_t pinDown; diff --git a/platformio.ini b/platformio.ini index 7246a53..ebfb9b6 100644 --- a/platformio.ini +++ b/platformio.ini @@ -23,13 +23,13 @@ default_envs = ; mega2560-5500 ; LightHub controller HW revision 2.1 and above (Wiznet 5500 CS on pin 53) -; lighthub21 + lighthub21 ; Arduino DUE + Ethernet shield Wiznet 5100 ; due-5100 ; Generic DUE - due +; due ; Arduino DUE + Ethernet shield Wiznet 5500 ; due-5500 @@ -581,8 +581,8 @@ framework = arduino board = due build_flags = !python get_build_flags.py lighthub21 ;upload_command = arduinoOTA -address 192.168.11.172 -port 65280 -username arduino -password password -b -upload /sketch -sketch $SOURCE -;upload_command = arduinoOTA -address 192.168.88.34 -port 65280 -username arduino -password password -b -upload /sketch -sketch $SOURCE -;upload_protocol = custom +upload_command = arduinoOTA -address 192.168.88.28 -port 65280 -username arduino -password password -b -upload /sketch -sketch $SOURCE +upload_protocol = custom lib_ignore = ;DS2482_OneWire //UNCOMMENT for software 1-wire driver DHT sensor library for ESPx