diff --git a/lighthub/colorchannel.cpp b/lighthub/colorchannel.cpp index c125c73..272b7e4 100644 --- a/lighthub/colorchannel.cpp +++ b/lighthub/colorchannel.cpp @@ -25,6 +25,7 @@ int colorChannel::getDefaultStorageType() { case 3: case 4: + case 5: return ST_HSV255; case 1: return ST_PERCENTS255; diff --git a/lighthub/config.cpp b/lighthub/config.cpp index 87e4acf..a801d66 100644 --- a/lighthub/config.cpp +++ b/lighthub/config.cpp @@ -1,4 +1,5 @@ #include "config.h" +#include "main.h" String systemConfig::getMACString() { @@ -28,6 +29,7 @@ bool systemConfig::isValidSysConf() stream->close(); return false; } + stream->close(); return true; }; @@ -289,4 +291,13 @@ bool systemConfig::getLoadHTTPConfig() return false; } + String systemConfig::getETAG() +{ +return "123"; +} +bool systemConfig::setETAG(String etag) +{ +debugSerial<=streamSize) return 0; return fs.available(); }; @@ -111,8 +112,8 @@ NRFFlashStorage EEPROM; debugSerial<<(F(" Res:"))<"<<(char)ch; #if defined(__AVR__) EEPROM.update(startPos+pos++,(char)ch); return 1; @@ -235,8 +230,8 @@ NRFFlashStorage EEPROM; #endif void flashStream::close() - { - flush(); + { + putEOF(); } diff --git a/lighthub/flashstream.h b/lighthub/flashstream.h index 9f8290e..5cfb6d4 100644 --- a/lighthub/flashstream.h +++ b/lighthub/flashstream.h @@ -35,13 +35,14 @@ public: }; virtual int open(String _filename, char mode) override; virtual int available() override; - virtual int read(); - virtual int peek(); + virtual int read() override; + virtual int peek() override; virtual unsigned int seek (unsigned int _pos = 0) override; virtual void close() override; virtual void flush() override; virtual size_t write(uint8_t ch); using Print::write; + virtual void putEOF() override {}; virtual ~flashStream (); }; @@ -58,15 +59,6 @@ public: void setSize(unsigned int _size); int open(short fileNum, char mode='\0') ; virtual int open(String _filename, char mode='\0') override; -/* - virtual int open(unsigned int _startPos=0, unsigned int _size=4096 char mode='\0') - { - pos = 0; - startPos = _startPos; - streamSize = _size; - return 1; - }; -*/ virtual unsigned int seek(unsigned int _pos = 0); virtual int available() override; virtual int read() ; diff --git a/lighthub/item.cpp b/lighthub/item.cpp index 692c49b..d9130ff 100644 --- a/lighthub/item.cpp +++ b/lighthub/item.cpp @@ -143,6 +143,7 @@ void Item::Parse() { case CH_RGBW: case CH_RGB: case CH_DIMMER: + case CH_RGBWW: driver = new out_dmx (this); // debugSerial<1) aJsonStream jsonEEPROMStream = aJsonStream(&sysConfStream); infoSerial<1) { if (!strcasecmp_P(args[1],ON_P)) {sysConf.setLoadHTTPConfig(true); return 200;}; @@ -1518,6 +1517,7 @@ bool loadConfigFromHttp(int arg_cnt, char **args) int responseStatusCode = 0; char URI[64]; char configServer[32]=""; + String etag=sysConf.getETAG(); if (arg_cnt > 1) { strncpy(configServer, args[1], sizeof(configServer) - 1); sysConf.setServer(configServer); @@ -1605,6 +1605,7 @@ bool loadConfigFromHttp(int arg_cnt, char **args) //debugSerial<<"making GET request");get debugSerial<itemType; } @@ -81,11 +83,15 @@ if (cType==CH_DIMMER) //Single channel return 1; } + int colorTemp = cmd.getColorTemp(); + switch (cType) { case CH_RGB: storageType=ST_RGB; break; + case CH_RGBWW: + cmd.setColorTemp(0); //Supress cold conversoin case CH_RGBW: storageType=ST_RGBW; break; @@ -98,9 +104,19 @@ st.assignFrom(cmd); debugSerial<