homebridge-syntex-magichome
Advanced tools
Comparing version 1.0.0-b32 to 1.0.0-b33
{ | ||
"name": "homebridge-syntex-magichome", | ||
"version": "1.0.0-b32", | ||
"version": "1.0.0-b33", | ||
"description": "Homebridge Plugin for MagicHome LED Strips with preset scenes", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -30,3 +30,5 @@ const LightBulb = require('./accessories/lightBulb'); | ||
server.SETUP(logger, this.port); | ||
server.SETUP('SynTexMagicHome', logger, this.port); | ||
server.addPage('/test', '<h1>Hallo Welt</h1>', () => { logger.debug('TEST') }); | ||
@@ -33,0 +35,0 @@ lightAgent.setLogger(logger); |
var server = exports; | ||
var http = require('http'); | ||
var url = require('url'); | ||
var logger; | ||
var logger, pages = []; | ||
server.SETUP = function(log, port) | ||
server.SETUP = function(prefix, log, port) | ||
{ | ||
@@ -23,2 +23,13 @@ logger = log; | ||
for(var i = 0; i < pages.length; i++) | ||
{ | ||
if(urlPath == pages[i].path) | ||
{ | ||
pages[i].callback(); | ||
response.write(pages[i].html); | ||
response.end(); | ||
} | ||
} | ||
/* | ||
if(urlPath == '/test') | ||
@@ -29,3 +40,3 @@ { | ||
} | ||
*/ | ||
}).bind(this); | ||
@@ -35,3 +46,10 @@ | ||
logger.log('info', 'bridge', 'Bridge', 'Data Link Server läuft auf Port [' + port + ']'); | ||
}; | ||
logger.log('info', 'bridge', 'Bridge', prefix + ' Server läuft auf Port [' + port + ']'); | ||
}; | ||
server.addPage() = function(path, html, callback) | ||
{ | ||
pages.push({ path : path, html : html, callback : callback }); | ||
logger.debug(JSON.stringify(pages)); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106309
1008