Новый веб!

This commit is contained in:
Dmitry Borisenko
2022-09-27 01:24:22 +02:00
parent e809c92c64
commit 1dd1958abc
11 changed files with 32 additions and 32 deletions

View File

@@ -17,8 +17,8 @@ void* getAPI_Pzem004(String subtype, String params);
void* getAPI_RCswitch(String subtype, String params);
void* getAPI_Sht20(String subtype, String params);
void* getAPI_Sht30(String subtype, String params);
void* getAPI_SoftUART(String subtype, String params);
void* getAPI_Sonar(String subtype, String params);
void* getAPI_UART(String subtype, String params);
void* getAPI_ButtonIn(String subtype, String params);
void* getAPI_ButtonOut(String subtype, String params);
void* getAPI_IoTServo(String subtype, String params);
@@ -47,8 +47,8 @@ if ((tmpAPI = getAPI_Pzem004(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_RCswitch(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_Sht20(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_Sht30(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_SoftUART(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_Sonar(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_UART(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_ButtonIn(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_ButtonOut(subtype, params)) != nullptr) return tmpAPI;
if ((tmpAPI = getAPI_IoTServo(subtype, params)) != nullptr) return tmpAPI;

View File

@@ -3,7 +3,7 @@
#include "classes/IoTItem.h"
#include "PZEMSensor.h"
#include "modules/sensors/SoftUart/SoftUart.h"
#include "modules/sensors/UART/Uart.h"
PZEMSensor* pzem;

View File

@@ -3,7 +3,7 @@
#include "classes/IoTItem.h"
#include <Arduino.h>
#include "modules/sensors/SoftUart/SoftUart.h"
#include "modules/sensors/UART/Uart.h"
#ifdef ESP8266
SoftwareSerial* myUART = nullptr;
@@ -11,14 +11,14 @@ SoftwareSerial* myUART = nullptr;
HardwareSerial* myUART = nullptr;
#endif
class SoftUART : public IoTItem {
class UART : public IoTItem {
private:
int tx;
int rx;
int speed;
public:
SoftUART(String parameters) : IoTItem(parameters) {
UART(String parameters) : IoTItem(parameters) {
tx = jsonReadInt(parameters, "tx");
rx = jsonReadInt(parameters, "rx");
speed = jsonReadInt(parameters, "speed");
@@ -60,9 +60,9 @@ class SoftUART : public IoTItem {
}
};
void* getAPI_SoftUART(String subtype, String param) {
if (subtype == F("SoftUART")) {
return new SoftUART(param);
void* getAPI_UART(String subtype, String param) {
if (subtype == F("UART")) {
return new UART(param);
} else {
return nullptr;
}

View File

@@ -4,7 +4,7 @@
{
"name": "UART",
"type": "Reading",
"subtype": "SoftUART",
"subtype": "UART",
"page": "",
"descr": "",
"widget": "nil",
@@ -19,7 +19,7 @@
"authorContact": "https://t.me/Dmitry_Borisenko",
"authorGit": "https://github.com/DmitryBorisenko33",
"specialThanks": "Serghei Crasnicov @Serghei63",
"moduleName": "SoftUART",
"moduleName": "UART",
"moduleVersion": "1.0",
"usedRam": 15,
"subTypes": [