mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-27 14:42:18 +03:00
websocket & function
This commit is contained in:
@@ -44,11 +44,23 @@ void SensorDht::readTmpHum() {
|
||||
eventGen2(_paramsTmp.key, String(tmp));
|
||||
jsonWriteStr(configLiveJson, _paramsTmp.key, String(tmp));
|
||||
publishStatus(_paramsTmp.key, String(tmp));
|
||||
String path = mqttRootDevice + "/" +_paramsTmp.key + "/status";
|
||||
String json = "{}";
|
||||
jsonWriteStr(json, "status", String(tmp));
|
||||
String MyJson = json;
|
||||
jsonWriteStr(MyJson, "topic", path);
|
||||
ws.textAll(MyJson);
|
||||
SerialPrint("I", "Sensor", "'" + _paramsTmp.key + "' data: " + String(tmp));
|
||||
|
||||
eventGen2(_paramsHum.key, String(hum));
|
||||
jsonWriteStr(configLiveJson, _paramsHum.key, String(hum));
|
||||
publishStatus(_paramsHum.key, String(hum));
|
||||
path = mqttRootDevice + "/" +_paramsHum.key + "/status";
|
||||
json = "{}";
|
||||
jsonWriteStr(json, "status", String(hum));
|
||||
MyJson = json;
|
||||
jsonWriteStr(MyJson, "topic", path);
|
||||
ws.textAll(MyJson);
|
||||
SerialPrint("I", "Sensor", "'" + _paramsHum.key + "' data: " + String(hum));
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user