mirror of
https://gitlab.com/zwirbel/illucat.git
synced 2025-12-15 01:42:22 +01:00
move pixel plugin back to illucat, introduce setup method for better encapsulation of plugins in order to remove activation method
This commit is contained in:
@@ -36,23 +36,16 @@ class IlluCat : public Sprocket {
|
||||
sprocketConfig = cfg;
|
||||
otaConfig = otaCfg;
|
||||
webConfig = webCfg;
|
||||
server = new AsyncWebServer(80);
|
||||
}
|
||||
|
||||
Sprocket* activate(Scheduler* scheduler, Network* network) {
|
||||
|
||||
server = new AsyncWebServer(80);
|
||||
// TODO how can any type of API be linked to another one?
|
||||
// TODO add HTTP OTA instead of TCP
|
||||
//addPlugin(new OtaTcpPlugin(otaConfig));
|
||||
void setup(){
|
||||
addPlugin(new PixelPlugin());
|
||||
addPlugin(new WebServerPlugin(webConfig, server));
|
||||
addPlugin(new WebConfigPlugin(server));
|
||||
addPlugin(new WebApi(server, 1));
|
||||
|
||||
// setup web stuff
|
||||
server->serveStatic(PIXEL_CONFIG_FILE, SPIFFS, "pixelConfig.json");
|
||||
|
||||
return Sprocket::activate(scheduler, network);
|
||||
} using Sprocket::activate;
|
||||
}
|
||||
|
||||
// TODO move to Sprocket
|
||||
virtual void dispatch( uint32_t from, String &msg ) {
|
||||
|
||||
@@ -18,7 +18,7 @@ IlluCat sprocket(
|
||||
);
|
||||
|
||||
void setup() {
|
||||
sprocket.addPlugin(new PixelPlugin());
|
||||
sprocket.setup();
|
||||
sprocket.join(net);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ MeshCat sprocket(
|
||||
);
|
||||
|
||||
void setup() {
|
||||
sprocket.addPlugin(new PixelPlugin());
|
||||
sprocket.setup();
|
||||
sprocket.join(net);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user