diff --git a/lib/NeoPattern/NeoPatternDto.h b/lib/NeoPattern/NeoPatternDto.h deleted file mode 100644 index 795b9c1..0000000 --- a/lib/NeoPattern/NeoPatternDto.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef __NEOPATTERN_STATE__ -#define __NEOPATTERN_STATE__ - -#include -#include "utils/utils_print.h" -#include "JsonStruct.h" - - -struct NeoPixelConfig : public JsonStruct { - // FIXME constants! - int pin = 4; - int length = 8; - int brightness = 100; - int updateInterval = 100; - int defaultColor = 100; // FIXME remove unused - void mapJsonObject(JsonObject& root) { - root["pin"] = pin; - root["length"] = length; - root["brightness"] = brightness; - root["updateInterval"] = updateInterval; - root["defaultColor"] = defaultColor; - } - void fromJsonObject(JsonObject& json) { - pin = getIntAttrFromJson(json, "pin", pin); - length = getIntAttrFromJson(json, "length", length); - brightness = getIntAttrFromJson(json, "brightness", brightness); - updateInterval = getIntAttrFromJson(json, "updateInterval", updateInterval); - defaultColor = getIntAttrFromJson(json, "defaultColor", defaultColor); - } -}; - -struct NeoPatternState : public JsonStruct { - uint pattern = 0; - uint color= 0; - uint color2= 0; - uint totalSteps = 16; - uint brightness = 64; - - void mapJsonObject(JsonObject& root) { - root["pattern"] = pattern; - root["color"] = color; - root["color2"] = color2; - root["totalSteps"] = totalSteps; - root["brightness"] = brightness; - - } - // Map a json object to this struct. - void fromJsonObject(JsonObject& json){ - if(!verifyJsonObject(json)){ - PRINT_MSG(Serial, "fromJsonObject", "cannot parse JSON"); - valid = 0; - return; - } - color = getIntAttrFromJson(json, "color", color); - color2 = getIntAttrFromJson(json, "color2", color2); - pattern = getIntAttrFromJson(json, "pattern", pattern); - brightness = getIntAttrFromJson(json, "brightness", brightness); - totalSteps = getIntAttrFromJson(json, "totalSteps", totalSteps); - valid = 1; - }; -}; - - -#endif \ No newline at end of file diff --git a/lib/NeoPattern/NeoPattern.cpp b/src/NeoPattern.cpp similarity index 100% rename from lib/NeoPattern/NeoPattern.cpp rename to src/NeoPattern.cpp diff --git a/lib/NeoPattern/NeoPatternState.h b/src/NeoPatternState.h similarity index 100% rename from lib/NeoPattern/NeoPatternState.h rename to src/NeoPatternState.h diff --git a/lib/NeoPattern/NeoPixelConfig.h b/src/NeoPixelConfig.h similarity index 100% rename from lib/NeoPattern/NeoPixelConfig.h rename to src/NeoPixelConfig.h diff --git a/src/PixelPlugin.h b/src/PixelPlugin.h index 5615aae..19f6acc 100644 --- a/src/PixelPlugin.h +++ b/src/PixelPlugin.h @@ -5,12 +5,10 @@ #define _TASK_STD_FUNCTION #include "TaskSchedulerDeclarations.h" -#include "MeshNet.h" #include "Plugin.h" #include "NeoPixelConfig.h" #include "NeoPatternState.h" #include "NeoPattern.cpp" -#include "config.h" using namespace std; using namespace std::placeholders;