mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-06 15:51:25 +00:00
Online status
This commit is contained in:
1 parent
c683e1e988
commit
d128d2146a
1 file changed
+4
-3
@@ -450,8 +450,8 @@ const App = function() {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
subscribe(statusTopic)
|
subscribe(statusTopic);
|
||||||
subscribe(txTopic)
|
subscribe(txTopic);
|
||||||
});
|
});
|
||||||
|
|
||||||
MqttClient.on('message', (topic, message) => {
|
MqttClient.on('message', (topic, message) => {
|
||||||
@@ -472,7 +472,8 @@ const App = function() {
|
|||||||
console.error('Invalid response');
|
console.error('Invalid response');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
device.online = params.status === 'online'
|
device.online = params.status === 'online';
|
||||||
|
setConnected(device.online);
|
||||||
if (device.online) {
|
if (device.online) {
|
||||||
device.config = params;
|
device.config = params;
|
||||||
if (!device.config.pins) device.config.pins = [];
|
if (!device.config.pins) device.config.pins = [];
|
||||||
|
|||||||
Reference in new issue
Block a user