multiple web config

This commit is contained in:
2018-09-13 01:17:11 +02:00
parent beacbb2fb3
commit 5ffb0d32c9
3 changed files with 33 additions and 23 deletions

View File

@@ -91,6 +91,7 @@ class IlluCat : public MeshSprocket {
defaultAnimation();
// setup web stuff
server->serveStatic("/pixelConfig.json", SPIFFS, "pixelConfig.json");
server->on("/pixel/pattern", HTTP_POST, bind(&IlluCat::patternWebRequestHandler, this, _1));
ws->onEvent(bind(&IlluCat::onWsEvent, this, _1, _2, _3, _4, _5, _6));
server->addHandler(ws);
@@ -126,7 +127,9 @@ class IlluCat : public MeshSprocket {
virtual void onNewConnection(uint32_t nodeId){
PRINT_MSG(Serial, SPROCKET_TYPE, "connected to %u", nodeId);
defaultAnimation();
//defaultAnimation();
String stateJson = state.toJsonString();
net->mesh.sendSingle(nodeId, stateJson);
// TODO publish current state to pixel/color on new node
}
virtual void onConnectionChanged(){