mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
кастомный сенсор
This commit is contained in:
@@ -34,3 +34,4 @@
|
|||||||
0;uptime;uptid;anydataTime;Системные;%name%#uptime;order;int[60]*
|
0;uptime;uptid;anydataTime;Системные;%name%#uptime;order;int[60]*
|
||||||
0;sht20;tmpid;anydataTemp;Сенсоры;Температура;1;c[1]
|
0;sht20;tmpid;anydataTemp;Сенсоры;Температура;1;c[1]
|
||||||
0;sht20;humid;anydataHum;Сенсоры;Влажность;2;c[1];int[50]*
|
0;sht20;humid;anydataHum;Сенсоры;Влажность;2;c[1];int[50]*
|
||||||
|
0;sensor;anyid;anydata;Сенсоры;Параметр;1;c[1];int[10];type[type1]*
|
||||||
Binary file not shown.
@@ -1,12 +1,12 @@
|
|||||||
#include "sensors/YourSensor.h"
|
#include "YourSensor.h"
|
||||||
|
|
||||||
float yourSensorReading(String type) {
|
float yourSensorReading(String type) {
|
||||||
float value;
|
float value;
|
||||||
if (type == "name1") {
|
if (type == "type1") {
|
||||||
value++;
|
value++;
|
||||||
} else if (type == "name2") {
|
} else if (type == "type2") {
|
||||||
value--;
|
value--;
|
||||||
} else if (type == "name3") {
|
} else if (type == "type3") {
|
||||||
value = value + 10;
|
value = value + 10;
|
||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
@@ -5,8 +5,8 @@
|
|||||||
#include "BufferExecute.h"
|
#include "BufferExecute.h"
|
||||||
#include "Class/LineParsing.h"
|
#include "Class/LineParsing.h"
|
||||||
#include "Global.h"
|
#include "Global.h"
|
||||||
|
#include "YourSensor.h"
|
||||||
#include "items/vSensorAny.h"
|
#include "items/vSensorAny.h"
|
||||||
#include "sensors/SensorYour.h"
|
|
||||||
|
|
||||||
SensorAny::SensorAny(const String& paramsAny) {
|
SensorAny::SensorAny(const String& paramsAny) {
|
||||||
_paramsAny = paramsAny;
|
_paramsAny = paramsAny;
|
||||||
|
|||||||
Reference in New Issue
Block a user