Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function setFAN_Day(fanLevel)
- {
- log("setze Tag Lüftung auf Stufe " + fanLevel);
- sendRequest2ISG('data=[{"name":"val82","value":"' + parseInt(fanLevel) + '"}]');
- }
- function setFAN_Night(fanLevel)
- {
- log("setze Nacht Lüftung auf Stufe " + fanLevel);
- sendRequest2ISG('data=[{"name":"val83","value":"' + parseInt(fanLevel) + '"}]');
- }
- function setHystereseAndFussPunkt(hysterese1, asymHysterese, fussPunkt)
- {
- sendRequest2ISG('data=[{"name":"val162","value":"' + parseFloat(hysterese1) + '"},{"name":"val167","value":"' + parseFloat(asymHysterese) + '"},{"name":"val16","value":"' + parseFloat(fussPunkt) + '"}]');
- }
- function sendRequest2ISG(data)
- {
- var request = require('request');
- request.post(
- {
- url: 'http://192.168.10.4/save.php',
- form: data
- },
- function(error, response, body)
- {
- if (!error && response.statusCode === 200) {
- log("ISG response: " + JSON.stringify(body));
- }
- else
- {
- log("error during ISG request: " + error);
- log("response.statusCode: " + response.statusCode);
- log("response.statusText: " + response.statusText);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment