Skip to content

Commit

Permalink
The browser now updates right away after changing a status
Browse files Browse the repository at this point in the history
(Server wasn't responding to the POST request)
  • Loading branch information
Sebdar committed Jul 8, 2019
1 parent ba9dec7 commit d379651
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion mqtt_blinds/blinds.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ client.on('message', (topic, message) => {
status.setAuto();
}
else
console.log('WARNING : Could not recognize force autoheat message');
console.log('WARNING : Could not recognize force autoblinds message');

}
else
Expand Down
2 changes: 1 addition & 1 deletion mqtt_serv/html/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async function changeStatus(route) {
} else {
console.log('HTTP Error : code', receive.status);
}
setTimeout(updateAll, 100);
setTimeout(updateAll, 500);

} catch(e) { console.log('ERROR API : ', e);}

Expand Down
1 change: 1 addition & 0 deletions mqtt_serv/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ httpServer.post('/force/heating', (req, res) => {
message.payload = 'error';
}
res.status(200);
res.send();
mqttServer.publish(message);
});
httpServer.post('/force/heatingauto', (req, res) => {
Expand Down

0 comments on commit d379651

Please sign in to comment.