mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
267 Scenario bug fully fixed Stable
This commit is contained in:
@@ -52,7 +52,7 @@ class ButtonInClass : public LineParsing {
|
||||
}
|
||||
|
||||
void switchChangeVirtual(String key, String state) {
|
||||
eventGen(key, "");
|
||||
eventGen2(key, state);
|
||||
jsonWriteInt(configLiveJson, key, state.toInt());
|
||||
publishStatus(key, state);
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
else {
|
||||
digitalWrite(pinInt, !state.toInt());
|
||||
}
|
||||
eventGen(key, "");
|
||||
eventGen2(key, state);
|
||||
jsonWriteInt(configLiveJson, key, state.toInt());
|
||||
publishStatus(key, state);
|
||||
}
|
||||
|
||||
@@ -16,13 +16,13 @@ class InputClass : public LineParsing {
|
||||
}
|
||||
|
||||
void inputSetFloat(String key, String state) {
|
||||
eventGen(key, "");
|
||||
eventGen2(key, state);
|
||||
jsonWriteFloat(configLiveJson, key, state.toFloat());
|
||||
publishStatus(key, state);
|
||||
}
|
||||
|
||||
void inputSetStr(String key, String state) {
|
||||
eventGen(key, "");
|
||||
eventGen2(key, state);
|
||||
jsonWriteStr(configLiveJson, key, state);
|
||||
publishStatus(key, state);
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class OutputTextClass : public LineParsing {
|
||||
|
||||
void OutputModuleChange(String key, String state) {
|
||||
state.replace("#", " ");
|
||||
eventGen(key, "");
|
||||
eventGen2(key, state);
|
||||
jsonWriteStr(configLiveJson, key, state);
|
||||
publishStatus(key, state);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class PwmOutClass : public LineParsing {
|
||||
void pwmChange(String key, String pin, String state) {
|
||||
int pinInt = pin.toInt();
|
||||
analogWrite(pinInt, state.toInt());
|
||||
eventGen(key, "");
|
||||
eventGen2(key, state);
|
||||
jsonWriteInt(configLiveJson, key, state.toInt());
|
||||
publishStatus(key, state);
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ class SensorAnalogClass : public SensorConvertingClass {
|
||||
#endif
|
||||
value = this->mapping(key, value);
|
||||
float valueFl = this->correction(key, value);
|
||||
eventGen(key, "");
|
||||
eventGen2(key, String(valueFl));
|
||||
jsonWriteStr(configLiveJson, key, String(valueFl));
|
||||
publishStatus(key, String(valueFl));
|
||||
SerialPrint("I", "Sensor", "'" + key + "' data: " + String(valueFl));
|
||||
|
||||
@@ -25,7 +25,7 @@ class SensorBme280Class : public SensorConvertingClass {
|
||||
float value;
|
||||
value = bme.readTemperature();
|
||||
float valueFl = this->correction(key, value);
|
||||
eventGen(key, "");
|
||||
eventGen2(key, String(valueFl));
|
||||
jsonWriteStr(configLiveJson, key, String(valueFl));
|
||||
publishStatus(key, String(valueFl));
|
||||
SerialPrint("I", "Sensor", "'" + key + "' data: " + String(valueFl));
|
||||
@@ -35,7 +35,7 @@ class SensorBme280Class : public SensorConvertingClass {
|
||||
float value;
|
||||
value = bme.readHumidity();
|
||||
float valueFl = this->correction(key, value);
|
||||
eventGen(key, "");
|
||||
eventGen2(key, String(valueFl));
|
||||
jsonWriteStr(configLiveJson, key, String(valueFl));
|
||||
publishStatus(key, String(valueFl));
|
||||
SerialPrint("I", "Sensor", "'" + key + "' data: " + String(valueFl));
|
||||
@@ -46,7 +46,7 @@ class SensorBme280Class : public SensorConvertingClass {
|
||||
value = bme.readPressure();
|
||||
value = value / 1.333224 / 100;
|
||||
float valueFl = this->correction(key, value);
|
||||
eventGen(key, "");
|
||||
eventGen2(key, String(valueFl));
|
||||
jsonWriteStr(configLiveJson, key, String(valueFl));
|
||||
publishStatus(key, String(valueFl));
|
||||
SerialPrint("I", "Sensor", "'" + key + "' data: " + String(valueFl));
|
||||
|
||||
@@ -26,7 +26,7 @@ class SensorBmp280Class : public SensorConvertingClass {
|
||||
bmp_temp->getEvent(&temp_event);
|
||||
value = temp_event.temperature;
|
||||
float valueFl = this->correction(key, value);
|
||||
eventGen(key, "");
|
||||
eventGen2(key, String(valueFl));
|
||||
jsonWriteStr(configLiveJson, key, String(valueFl));
|
||||
publishStatus(key, String(valueFl));
|
||||
SerialPrint("I", "Sensor", "'" + key + "' data: " + String(valueFl));
|
||||
@@ -39,7 +39,7 @@ class SensorBmp280Class : public SensorConvertingClass {
|
||||
value = pressure_event.pressure;
|
||||
value = value / 1.333224;
|
||||
float valueFl = this->correction(key, value);
|
||||
eventGen(key, "");
|
||||
eventGen2(key, String(valueFl));
|
||||
jsonWriteStr(configLiveJson, key, String(valueFl));
|
||||
publishStatus(key, String(valueFl));
|
||||
SerialPrint("I", "Sensor", "'" + key + "' data: " + String(valueFl));
|
||||
|
||||
@@ -41,7 +41,7 @@ class SensorDhtClass : public SensorConvertingClass {
|
||||
if (String(value) != "nan") {
|
||||
//value = this->mapping(key, value);
|
||||
float valueFl = this->correction(key, value);
|
||||
eventGen(key, "");
|
||||
eventGen2(key, String(valueFl));
|
||||
jsonWriteStr(configLiveJson, key, String(valueFl));
|
||||
publishStatus(key, String(valueFl));
|
||||
SerialPrint("I", "Sensor", "'" + key + "' data: " + String(valueFl));
|
||||
@@ -65,7 +65,7 @@ class SensorDhtClass : public SensorConvertingClass {
|
||||
if (String(value) != "nan") {
|
||||
//value = this->mapping(key, value);
|
||||
float valueFl = this->correction(key, value);
|
||||
eventGen(key, "");
|
||||
eventGen2(key, String(valueFl));
|
||||
jsonWriteStr(configLiveJson, key, String(valueFl));
|
||||
publishStatus(key, String(valueFl));
|
||||
SerialPrint("I", "Sensor", "'" + key + "' data: " + String(valueFl));
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
// }
|
||||
//
|
||||
// int valueFl = this->correction(key, value);
|
||||
// eventGen(key, "");
|
||||
// eventGen2(key, String(valueFl));
|
||||
// jsonWriteStr(configLiveJson, key, String(valueFl));
|
||||
// publishStatus(key, String(valueFl));
|
||||
// SerialPrint("I", "Sensor", "'" + key + "' data: " + String(valueFl) + ", Slave dev addr: " + String(slaveAddress) + ", Register: " + String(regAddress));
|
||||
|
||||
@@ -40,7 +40,7 @@ class SensorUltrasonic : public SensorConvertingClass {
|
||||
|
||||
value = this->mapping(key, value);
|
||||
float valueFl = this->correction(key, value);
|
||||
eventGen(key, "");
|
||||
eventGen2(key, String(valueFl));
|
||||
jsonWriteStr(configLiveJson, key, String(valueFl));
|
||||
publishStatus(key, String(valueFl));
|
||||
SerialPrint("I", "Sensor", "'" + key + "' data: " + String(valueFl));
|
||||
|
||||
Reference in New Issue
Block a user