add webserver with API for controlling commands
This commit is contained in:
parent
57c6051f7d
commit
74ff694293
@ -23,7 +23,8 @@ lib_deps =
|
||||
sparkfun/SparkFun BME280@^2.0.9
|
||||
arkhipenko/TaskScheduler@^3.8.5
|
||||
https://git.hodos.ro/libraries/wifi.git@^2.0.0
|
||||
https://git.hodos.ro/libraries/ha-mqtt.git@^1.7.0
|
||||
https://git.hodos.ro/libraries/ha-mqtt.git@^1.8.0
|
||||
https://git.hodos.ro/libraries/ha-webserver.git@^1.0.0
|
||||
build_flags = -D WIFI_ALWAYS_ON=1 -D ADAFRUIT_BME=1
|
||||
|
||||
[env:laptop_home]
|
||||
|
||||
@ -23,6 +23,7 @@ void turnLed(bool on = true) {
|
||||
#include "devices.h"
|
||||
#include "mqtt.h"
|
||||
#include "ota.h"
|
||||
#include "webserver.h"
|
||||
|
||||
#define BUTTON D3
|
||||
|
||||
@ -63,6 +64,7 @@ void setup() {
|
||||
Mqtt::publishCleanupConfig();
|
||||
delay(2000);
|
||||
Mqtt::disconnect();
|
||||
WebServer::stop();
|
||||
});
|
||||
Ntp::setup();
|
||||
Bme::setup();
|
||||
@ -77,10 +79,12 @@ void setup() {
|
||||
Ota::tLoop.enable();
|
||||
Mqtt::tReConnect.enable();
|
||||
Ntp::tUpdateTime.enable();
|
||||
WebServer::setup();
|
||||
},
|
||||
[] {
|
||||
Ota::tLoop.disable();
|
||||
Mqtt::tReConnect.disable();
|
||||
WebServer::stop();
|
||||
});
|
||||
|
||||
pinMode(BUTTON, INPUT_PULLUP);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user