mirror of
https://github.com/cesanta/mongoose.git
synced 2025-08-06 05:26:15 +08:00
Online status
This commit is contained in:
parent
c683e1e988
commit
d128d2146a
@ -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 = [];
|
||||||
|
Loading…
Reference in New Issue
Block a user