mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 14:12:16 +03:00
исправление бага времени гейта mysensors
This commit is contained in:
@@ -80,6 +80,14 @@
|
|||||||
"path": "src/modules/sensors/Ble",
|
"path": "src/modules/sensors/Ble",
|
||||||
"active": false
|
"active": false
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "src/modules/sensors/Ble_part1",
|
||||||
|
"active": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "src/modules/sensors/Ble_part2",
|
||||||
|
"active": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "src/modules/sensors/Bme280",
|
"path": "src/modules/sensors/Bme280",
|
||||||
"active": true
|
"active": true
|
||||||
@@ -312,6 +320,10 @@
|
|||||||
"path": "src/modules/display/Lcd2004",
|
"path": "src/modules/display/Lcd2004",
|
||||||
"active": true
|
"active": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"path": "src/modules/display/NextionUpload",
|
||||||
|
"active": false
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"path": "src/modules/display/Oled128",
|
"path": "src/modules/display/Oled128",
|
||||||
"active": false
|
"active": false
|
||||||
|
|||||||
@@ -597,7 +597,6 @@ lib_deps =
|
|||||||
adafruit/Adafruit BMP280 Library
|
adafruit/Adafruit BMP280 Library
|
||||||
beegee-tokyo/DHT sensor library for ESPx
|
beegee-tokyo/DHT sensor library for ESPx
|
||||||
https://github.com/milesburton/Arduino-Temperature-Control-Library
|
https://github.com/milesburton/Arduino-Temperature-Control-Library
|
||||||
https://github.com/tremaru/iarduino_RTC
|
|
||||||
robtillaart/SHT2x@^0.1.1
|
robtillaart/SHT2x@^0.1.1
|
||||||
WEMOS SHT3x@1.0.0
|
WEMOS SHT3x@1.0.0
|
||||||
plerup/EspSoftwareSerial
|
plerup/EspSoftwareSerial
|
||||||
@@ -618,9 +617,9 @@ build_src_filter =
|
|||||||
+<modules/virtual/Cron>
|
+<modules/virtual/Cron>
|
||||||
+<modules/virtual/Loging>
|
+<modules/virtual/Loging>
|
||||||
+<modules/virtual/LogingDaily>
|
+<modules/virtual/LogingDaily>
|
||||||
|
+<modules/virtual/owmWeather>
|
||||||
+<modules/virtual/Timer>
|
+<modules/virtual/Timer>
|
||||||
+<modules/virtual/Variable>
|
+<modules/virtual/Variable>
|
||||||
+<modules/virtual/VariableColor>
|
|
||||||
+<modules/virtual/VButton>
|
+<modules/virtual/VButton>
|
||||||
+<modules/sensors/Acs712>
|
+<modules/sensors/Acs712>
|
||||||
+<modules/sensors/AhtXX>
|
+<modules/sensors/AhtXX>
|
||||||
@@ -645,6 +644,7 @@ build_src_filter =
|
|||||||
+<modules/exec/Mcp23017>
|
+<modules/exec/Mcp23017>
|
||||||
+<modules/exec/Mp3>
|
+<modules/exec/Mp3>
|
||||||
+<modules/exec/Multitouch>
|
+<modules/exec/Multitouch>
|
||||||
|
+<modules/exec/MySensors>
|
||||||
+<modules/exec/Pcf8574>
|
+<modules/exec/Pcf8574>
|
||||||
+<modules/exec/Pwm32>
|
+<modules/exec/Pwm32>
|
||||||
+<modules/exec/TelegramLT>
|
+<modules/exec/TelegramLT>
|
||||||
|
|||||||
@@ -3,11 +3,6 @@
|
|||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
#include "MySensorsGate.h"
|
#include "MySensorsGate.h"
|
||||||
|
|
||||||
// временное решение
|
|
||||||
unsigned long currentMillis;
|
|
||||||
unsigned long prevMillis;
|
|
||||||
unsigned long difference;
|
|
||||||
|
|
||||||
#ifdef MYSENSORS
|
#ifdef MYSENSORS
|
||||||
// callback библиотеки mysensors
|
// callback библиотеки mysensors
|
||||||
void receive(const MyMessage& message) {
|
void receive(const MyMessage& message) {
|
||||||
@@ -58,16 +53,11 @@ String parseToString(const MyMessage& message) {
|
|||||||
class MySensorsGate : public IoTItem {
|
class MySensorsGate : public IoTItem {
|
||||||
private:
|
private:
|
||||||
public:
|
public:
|
||||||
MySensorsGate(String parameters) : IoTItem(parameters) {
|
MySensorsGate(String parameters) : IoTItem(parameters) { SerialPrint("i", "MySensors", "Gate initialized"); }
|
||||||
SerialPrint("i", "MySensors", "Gate initialized");
|
|
||||||
}
|
|
||||||
|
|
||||||
void doByInterval() {
|
void doByInterval() {}
|
||||||
}
|
|
||||||
|
|
||||||
void loop() {
|
void loop() { loopMySensorsExecute(); }
|
||||||
loopMySensorsExecute();
|
|
||||||
}
|
|
||||||
|
|
||||||
~MySensorsGate(){};
|
~MySensorsGate(){};
|
||||||
|
|
||||||
@@ -356,6 +346,10 @@ class MySensorsNode : public IoTItem {
|
|||||||
int _minutesPassed = 0;
|
int _minutesPassed = 0;
|
||||||
String json = "{}";
|
String json = "{}";
|
||||||
bool dataFromNode = false;
|
bool dataFromNode = false;
|
||||||
|
// временное решение
|
||||||
|
unsigned long currentMillis;
|
||||||
|
unsigned long prevMillis;
|
||||||
|
unsigned long difference;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
MySensorsNode(String parameters) : IoTItem(parameters) {
|
MySensorsNode(String parameters) : IoTItem(parameters) {
|
||||||
@@ -393,9 +387,7 @@ class MySensorsNode : public IoTItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// событие когда пользователь подключается приложением или веб интерфейсом к усройству
|
// событие когда пользователь подключается приложением или веб интерфейсом к усройству
|
||||||
void onMqttWsAppConnectEvent() {
|
void onMqttWsAppConnectEvent() { setNewWidgetAttributes(); }
|
||||||
setNewWidgetAttributes();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setNewWidgetAttributes() {
|
void setNewWidgetAttributes() {
|
||||||
if (dataFromNode) {
|
if (dataFromNode) {
|
||||||
@@ -431,4 +423,4 @@ void* getAPI_MySensorsGate(String subtype, String param) {
|
|||||||
} else {
|
} else {
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user