loxone-api.js
function(url, callback) {
        url = getBaseUrl() + url;

        http.get(url, function(response) {
            var output = "";
            response.on('data', function (chunk) {
                output += chunk;
            });

            response.on('end', function() {
                output = JSON.parse(output);
                if (debug) {console.log(output);}

                if (output == undefined) {
                    output = {
                        LL: {
                            Code: 500,
                            value: undefined,
                            message: 'Unable to get response from Loxone Miniserver'
                        }
                    }
                }

                // return our current value
                callback(output);
            });
        }).on('error', function(e) {
            console.log("Got error: " + e.message);
            callback({
                LL: {
                    Code: 500,
                    value: undefined,
                    message: e.message
                }
            });
        });
    }
function(url, callback) {
        url = getBaseUrl() + url;

        http.get(url, function(response) {
            var output = "";
            response.on('data', function (chunk) {
                output += chunk;
            });

            response.on('end', function() {
                output = JSON.parse(output);
                if (debug) {console.log(output);}

                if (output == undefined) {
                    output = {
                        LL: {
                            Code: 500,
                            value: undefined,
                            message: 'Unable to get response from Loxone Miniserver'
                        }
                    }
                }

                // return our current value
                callback(output);
            });
        }).on('error', function(e) {
            console.log("Got error: " + e.message);
            callback({
                LL: {
                    Code: 500,
                    value: undefined,
                    message: e.message
                }
            });
        });
    }
function ( url , callback ) { url = getBaseUrl ( ) + url ; http . get ( url , function ( response ) { var output = "" ; response . on ( 'data' , function ( chunk ) { output += chunk ; } ) ; response . on ( 'end' , function ( ) { output = JSON . parse ( output ) ; if ( debug ) { console . log ( output ) ; } if ( output == undefined ) { output = { LL : { Code : 500 , value : undefined , message : 'Unable to get response from Loxone Miniserver' } } } // return our current value callback ( output ) ; } ) ; } ) . on ( 'error' , function ( e ) { console . log ( "Got error: " + e . message ) ; callback ( { LL : { Code : 500 , value : undefined , message : e . message } } ) ; } ) ; }
UTILITY METHODS +++++++++++++++++++++++++++++
UTILITY METHODS +++++++++++++++++++++++++++++