2 Commits

Author SHA1 Message Date
e6fe4a5ee9 event emitting on change in geofences 2018-04-11 17:06:05 +02:00
fca448a1ea geofences started 2018-04-11 16:30:34 +02:00
13 changed files with 560 additions and 95 deletions

View File

@ -8,5 +8,12 @@
"smtpSender": "dispatcher@hottis.de", "smtpSender": "dispatcher@hottis.de",
"smtpReceiver": "woho@hottis.de", "smtpReceiver": "woho@hottis.de",
"homekitFile": "homekit.json", "homekitFile": "homekit.json",
"openhabItemFile": "openhab.items" "openhabItemFile": "openhab.items",
"geofencesPort": 8000,
"occupants": {
"386D105B-80D0-4708-95AB-77B4D1E36D0E": "Wolfgang",
"E24E910A-ED0A-444E-8290-794339BC887C": "Matthias",
"D7352171-FCF5-4E21-8FD3-8C34FF0F2F15": "Anna",
"219117FF-B721-43E3-BE56-F77E8239705E": "Patty"
}
} }

45
dist/GeoFences.js vendored Normal file
View File

@ -0,0 +1,45 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express = require("express");
const logger = require("./log");
const bodyParser = require("body-parser");
const config = require("./config");
const MqttDispatcher_1 = require("./MqttDispatcher");
const events_1 = require("events");
class GeoFences extends events_1.EventEmitter {
constructor() {
super();
this.app = express();
this.app.use(bodyParser.urlencoded({ extended: false }));
this.app.use(bodyParser.json());
this.attendanceSheet = {};
}
exec() {
this.app.post('/', (req, res) => {
const reqData = req.body;
const deviceId = reqData.device;
let occupantName = 'unknown';
const location = reqData.name;
if (deviceId in config.dict.occupants) {
occupantName = config.dict.occupants[deviceId];
}
const presence = reqData.entry == '1';
const direction = presence ? 'arrives at' : 'leaves from';
logger.info(`${deviceId} (${occupantName}) ${direction} ${location}`);
logger.info(JSON.stringify(reqData));
res.send('OK');
const state = presence ? 'present' : 'absent';
MqttDispatcher_1.mqttHandler.send(`${GeoFences.geoFencesTopicPre}/${occupantName}`, state);
this.attendanceSheet[occupantName] = presence;
logger.info(`attendanceSheet is now ${JSON.stringify(this.attendanceSheet)}`);
this.emit('change', this.attendanceSheet);
});
let port = parseInt(config.dict.geofencesPort);
this.server = this.app.listen(port, '', () => {
logger.info(`geofences server listening on ${port}`);
});
}
}
GeoFences.geoFencesTopicPre = "dispatcher_ng/geofences";
exports.GeoFences = GeoFences;
//# sourceMappingURL=GeoFences.js.map

14
dist/HeatingScene.js vendored
View File

@ -1,14 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Forwarder_1 = require("./Forwarder");
class HeatingScene extends Forwarder_1.Forwarder {
constructor(floor, room, item, label, targetItems) {
let inTopics = [];
targetItems.forEach((item) => {
inTopics.push(item.getInTopic());
});
super(floor, room, item, "command", label, inTopics);
}
}
exports.HeatingScene = HeatingScene;
//# sourceMappingURL=HeatingScene.js.map

12
dist/MaxThermostat.js vendored
View File

@ -54,16 +54,13 @@ class MaxThermostat extends AHomegearItem_1.AHomegearItem {
setTemperature = true; setTemperature = true;
} }
else if (topic == this.commandTopic) { else if (topic == this.commandTopic) {
if ((payload == 'ON') && this.heatingMainFlag) { if (this.heatingMainFlag) {
if (payload == 'ON') {
this.temperature = this.presetTemperature; this.temperature = this.presetTemperature;
setTemperature = true;
} }
else if (payload == 'OFF') { else if (payload == 'OFF') {
this.temperature = DISABLED_TEMPERATURE; this.temperature = DISABLED_TEMPERATURE;
setTemperature = true;
} }
else if (payload == 'FORCE_ON') {
this.temperature = this.presetTemperature;
setTemperature = true; setTemperature = true;
} }
} }
@ -71,9 +68,8 @@ class MaxThermostat extends AHomegearItem_1.AHomegearItem {
this.heatingMainFlag = (payload == 'ON'); this.heatingMainFlag = (payload == 'ON');
logger.info(`${this.itemId} heating main: ${this.heatingMainFlag}`); logger.info(`${this.itemId} heating main: ${this.heatingMainFlag}`);
if (!this.heatingMainFlag) { if (!this.heatingMainFlag) {
this.temperature = DISABLED_TEMPERATURE; MqttDispatcher_1.mqttHandler.send(this.temperatureFeedbackTopic, `${DISABLED_TEMPERATURE}`);
MqttDispatcher_1.mqttHandler.send(this.temperatureFeedbackTopic, `${this.temperature}`); MqttDispatcher_1.mqttHandler.send(this.actionTopic, `${DISABLED_TEMPERATURE}`);
MqttDispatcher_1.mqttHandler.send(this.actionTopic, `${this.temperature}`);
} }
} }
else if (topic == this.presetTemperatureTopic) { else if (topic == this.presetTemperatureTopic) {

18
dist/main.js vendored
View File

@ -20,10 +20,9 @@ const Cron_1 = require("./Cron");
const HueColorBulbItem_1 = require("./HueColorBulbItem"); const HueColorBulbItem_1 = require("./HueColorBulbItem");
const TouchSwitchMultiButtonThing_1 = require("./TouchSwitchMultiButtonThing"); const TouchSwitchMultiButtonThing_1 = require("./TouchSwitchMultiButtonThing");
const RelayBox_1 = require("./RelayBox"); const RelayBox_1 = require("./RelayBox");
const HeatingScene_1 = require("./HeatingScene"); const GeoFences_1 = require("./GeoFences");
logger.info("Dispatcher starting"); logger.info("Dispatcher starting");
let allLabeledItems = new Array(); let allLabeledItems = new Array();
let allThermostatItems = new Array();
// Anna ----------------------------------------------------------------------------------------------------- // Anna -----------------------------------------------------------------------------------------------------
// Anna Aquarium 14665044 24 1 14665041 24 1 // Anna Aquarium 14665044 24 1 14665041 24 1
let aquariumLight = new M433SwitchItem_1.M433SwitchItem('1st', 'Anna', 'AquariumLight', 'Aquariumlicht', '14665044 24 1', '14665041 24 1'); let aquariumLight = new M433SwitchItem_1.M433SwitchItem('1st', 'Anna', 'AquariumLight', 'Aquariumlicht', '14665044 24 1', '14665041 24 1');
@ -48,7 +47,6 @@ let thermostatAnna1st = new MaxThermostat_1.MaxThermostat('1st', 'Anna', 'Thermo
thermostatAnna1st.start(); thermostatAnna1st.start();
thermostatAnna1st.setPresetTemperature(21.0); thermostatAnna1st.setPresetTemperature(21.0);
allLabeledItems.push(thermostatAnna1st); allLabeledItems.push(thermostatAnna1st);
allThermostatItems.push(thermostatAnna1st);
let thermostatAnna1stCron = new Cron_1.Cron('thermostatAnna1stCron', thermostatAnna1st, [ let thermostatAnna1stCron = new Cron_1.Cron('thermostatAnna1stCron', thermostatAnna1st, [
{ cronTime: '00 05 06 * * *', output: 'ON' }, { cronTime: '00 05 06 * * *', output: 'ON' },
{ cronTime: '00 05 08 * * 1-5', output: 'OFF' }, { cronTime: '00 05 08 * * 1-5', output: 'OFF' },
@ -73,9 +71,6 @@ allLabeledItems.push(matthiasBedLight);
let matthiasSpeaker = new M433SwitchItem_1.M433SwitchItem('1st', 'Matthias', 'Speaker', 'Lautsprecher Matthias', '11 24 1', '10 24 1', 'outlet'); let matthiasSpeaker = new M433SwitchItem_1.M433SwitchItem('1st', 'Matthias', 'Speaker', 'Lautsprecher Matthias', '11 24 1', '10 24 1', 'outlet');
matthiasSpeaker.start(); matthiasSpeaker.start();
allLabeledItems.push(matthiasSpeaker); allLabeledItems.push(matthiasSpeaker);
let windowContactMatthias = new MaxWindowContact_1.MaxWindowContact('1st', 'Matthias', 'WindowContact', 'Fenster', 24);
windowContactMatthias.start();
allLabeledItems.push(windowContactMatthias);
// Esszimmer ------------------------------------------------------------------------------------------------ // Esszimmer ------------------------------------------------------------------------------------------------
// Esszimmer kleine Lampe 69653 24 1 69652 24 1 // Esszimmer kleine Lampe 69653 24 1 69652 24 1
let diningRoomSmallLight = new M433SwitchItem_1.M433SwitchItem('Gnd', 'DiningRoom', 'SmallLight', 'kleine Lampe Esszimmer', '69653 24 1', '69652 24 1'); let diningRoomSmallLight = new M433SwitchItem_1.M433SwitchItem('Gnd', 'DiningRoom', 'SmallLight', 'kleine Lampe Esszimmer', '69653 24 1', '69652 24 1');
@ -168,7 +163,6 @@ let thermostatBedroom1st = new MaxThermostat_1.MaxThermostat('1st', 'Bedroom', '
thermostatBedroom1st.start(); thermostatBedroom1st.start();
thermostatBedroom1st.setPresetTemperature(20.0); thermostatBedroom1st.setPresetTemperature(20.0);
allLabeledItems.push(thermostatBedroom1st); allLabeledItems.push(thermostatBedroom1st);
allThermostatItems.push(thermostatBedroom1st);
let thermostatBedroom1stCron = new Cron_1.Cron('thermostatBedroom1stCron', thermostatBedroom1st, [ let thermostatBedroom1stCron = new Cron_1.Cron('thermostatBedroom1stCron', thermostatBedroom1st, [
{ cronTime: '00 01 06 * * 1-5', output: 'ON' }, { cronTime: '00 01 06 * * 1-5', output: 'ON' },
{ cronTime: '00 01 09 * * 1-5', output: 'OFF' }, { cronTime: '00 01 09 * * 1-5', output: 'OFF' },
@ -215,7 +209,6 @@ let thermostatBathroomGnd = new MaxThermostat_1.MaxThermostat('Gnd', 'Bathroom',
thermostatBathroomGnd.start(); thermostatBathroomGnd.start();
thermostatBathroomGnd.setPresetTemperature(20.0); thermostatBathroomGnd.setPresetTemperature(20.0);
allLabeledItems.push(thermostatBathroomGnd); allLabeledItems.push(thermostatBathroomGnd);
allThermostatItems.push(thermostatBathroomGnd);
let thermostatBathroomGndCron = new Cron_1.Cron('thermostatBathroomGndCron', thermostatBathroomGnd, [ let thermostatBathroomGndCron = new Cron_1.Cron('thermostatBathroomGndCron', thermostatBathroomGnd, [
{ cronTime: '00 02 06 * * 1-5', output: 'ON' }, { cronTime: '00 02 06 * * 1-5', output: 'ON' },
{ cronTime: '00 02 08 * * 6,0', output: 'ON' }, { cronTime: '00 02 08 * * 6,0', output: 'ON' },
@ -231,7 +224,6 @@ let thermostatBathroom1st = new MaxThermostat_1.MaxThermostat('1st', 'Bathroom',
thermostatBathroom1st.start(); thermostatBathroom1st.start();
thermostatBathroom1st.setPresetTemperature(20.0); thermostatBathroom1st.setPresetTemperature(20.0);
allLabeledItems.push(thermostatBathroom1st); allLabeledItems.push(thermostatBathroom1st);
allThermostatItems.push(thermostatBathroom1st);
let thermostatBathroom1stCron = new Cron_1.Cron('thermostatBathroom1stCron', thermostatBathroom1st, [ let thermostatBathroom1stCron = new Cron_1.Cron('thermostatBathroom1stCron', thermostatBathroom1st, [
{ cronTime: '00 00 06 * * 1-5', output: 'ON' }, { cronTime: '00 00 06 * * 1-5', output: 'ON' },
{ cronTime: '00 00 08 * * 6,0', output: 'ON' }, { cronTime: '00 00 08 * * 6,0', output: 'ON' },
@ -258,7 +250,6 @@ let thermostatKitchen = new MaxThermostat_1.MaxThermostat('Gnd', 'Kitchen', 'The
thermostatKitchen.start(); thermostatKitchen.start();
thermostatKitchen.setPresetTemperature(20.0); thermostatKitchen.setPresetTemperature(20.0);
allLabeledItems.push(thermostatKitchen); allLabeledItems.push(thermostatKitchen);
allThermostatItems.push(thermostatKitchen);
let thermostatKitchenCron = new Cron_1.Cron('thermostatKitchenCron', thermostatKitchen, [ let thermostatKitchenCron = new Cron_1.Cron('thermostatKitchenCron', thermostatKitchen, [
{ cronTime: '00 00 06 * * 1-5', output: 'ON' }, { cronTime: '00 00 06 * * 1-5', output: 'ON' },
{ cronTime: '00 00 08 * * 6,0', output: 'ON' }, { cronTime: '00 00 08 * * 6,0', output: 'ON' },
@ -278,8 +269,11 @@ let relayBox = new RelayBox_1.RelayBoxThing('base', 'labor', 'relaybox', 'IoT/Co
relayBox.start(); relayBox.start();
allLabeledItems.push(relayBox); allLabeledItems.push(relayBox);
// ---------------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------------
let heatingSceneAll = new HeatingScene_1.HeatingScene('Gnd', 'House', 'Heatings', 'Alle Heizungen', allThermostatItems); let geoFences = new GeoFences_1.GeoFences();
heatingSceneAll.start(); geoFences.exec();
geoFences.on('change', (attendanceSheet) => {
logger.info(`geoFences change event: ${JSON.stringify(attendanceSheet)}`);
});
// ---------------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------------
let testFourButton = new HomematicFourButtonThing_1.HomematicFourButtonThing('Gnd', 'Hallway', 'TestButton', 9, [ let testFourButton = new HomematicFourButtonThing_1.HomematicFourButtonThing('Gnd', 'Hallway', 'TestButton', 9, [
new HomematicFourButtonThing_1.HomematicFourButtonSingleItem('dispatcher_ng/items/Gnd/Hallway/Testlight/dimmerIn'), new HomematicFourButtonThing_1.HomematicFourButtonSingleItem('dispatcher_ng/items/Gnd/Hallway/Testlight/dimmerIn'),

View File

@ -103,17 +103,6 @@
}, },
"config": {} "config": {}
}, },
"1st_Matthias_WindowContact": {
"id": "1st_Matthias_WindowContact",
"name": "Fenster",
"service": "ContactSensor",
"topic": {
"statusContactSensorState": "dispatcher_ng/items/1st/Matthias/WindowContact/state/feedback"
},
"payload": {
"onContactDetected": "CLOSED"
}
},
"Gnd_DiningRoom_SmallLight": { "Gnd_DiningRoom_SmallLight": {
"id": "Gnd_DiningRoom_SmallLight", "id": "Gnd_DiningRoom_SmallLight",
"name": "kleine Lampe Esszimmer", "name": "kleine Lampe Esszimmer",

View File

@ -6,7 +6,6 @@ Number Preset_1st_Anna_Thermostat "Preset_Thermostat Anna [%.1f °C]" {mqtt=">[l
Switch 1st_Matthias_StandLight "Stehlampen Matthias"{mqtt=">[localbroker:dispatcher_ng/items/1st/Matthias/StandLight/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/Matthias/StandLight/state/feedback:state:default]"} Switch 1st_Matthias_StandLight "Stehlampen Matthias"{mqtt=">[localbroker:dispatcher_ng/items/1st/Matthias/StandLight/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/Matthias/StandLight/state/feedback:state:default]"}
Switch 1st_Matthias_BedLight "Bettlicht Matthias"{mqtt=">[localbroker:dispatcher_ng/items/1st/Matthias/BedLight/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/Matthias/BedLight/state/feedback:state:default]"} Switch 1st_Matthias_BedLight "Bettlicht Matthias"{mqtt=">[localbroker:dispatcher_ng/items/1st/Matthias/BedLight/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/Matthias/BedLight/state/feedback:state:default]"}
Switch 1st_Matthias_Speaker "Lautsprecher Matthias"{mqtt=">[localbroker:dispatcher_ng/items/1st/Matthias/Speaker/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/Matthias/Speaker/state/feedback:state:default]"} Switch 1st_Matthias_Speaker "Lautsprecher Matthias"{mqtt=">[localbroker:dispatcher_ng/items/1st/Matthias/Speaker/state:command:*:default],<[localbroker:dispatcher_ng/items/1st/Matthias/Speaker/state/feedback:state:default]"}
Contact 1st_Matthias_WindowContact "Fenster" {mqtt="<[localbroker:dispatcher_ng/items/1st/Matthias/WindowContact/state/feedback:state:default]"}
Switch Gnd_DiningRoom_SmallLight "kleine Lampe Esszimmer"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/DiningRoom/SmallLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/DiningRoom/SmallLight/state/feedback:state:default]"} Switch Gnd_DiningRoom_SmallLight "kleine Lampe Esszimmer"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/DiningRoom/SmallLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/DiningRoom/SmallLight/state/feedback:state:default]"}
Switch Gnd_DiningRoom_StandLight "Stehlampe Esszimmer"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/DiningRoom/StandLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/DiningRoom/StandLight/state/feedback:state:default]"} Switch Gnd_DiningRoom_StandLight "Stehlampe Esszimmer"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/DiningRoom/StandLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/DiningRoom/StandLight/state/feedback:state:default]"}
Switch Gnd_DiningRoom_CupboardLight "Schranklicht Esszimmer"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/DiningRoom/CupboardLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/DiningRoom/CupboardLight/state/feedback:state:default]"} Switch Gnd_DiningRoom_CupboardLight "Schranklicht Esszimmer"{mqtt=">[localbroker:dispatcher_ng/items/Gnd/DiningRoom/CupboardLight/state:command:*:default],<[localbroker:dispatcher_ng/items/Gnd/DiningRoom/CupboardLight/state/feedback:state:default]"}

408
package-lock.json generated
View File

@ -4,6 +4,16 @@
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
"@types/body-parser": {
"version": "1.16.8",
"resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.16.8.tgz",
"integrity": "sha512-BdN2PXxOFnTXFcyONPW6t0fHjz2fvRZHVMFpaS0wYr+Y8fWEaNOs4V8LEu/fpzQlMx+ahdndgTaGTwPC+J/EeA==",
"dev": true,
"requires": {
"@types/express": "4.11.1",
"@types/node": "8.5.8"
}
},
"@types/chalk": { "@types/chalk": {
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://registry.npmjs.org/@types/chalk/-/chalk-2.2.0.tgz", "resolved": "https://registry.npmjs.org/@types/chalk/-/chalk-2.2.0.tgz",
@ -25,6 +35,39 @@
"integrity": "sha1-lcHkMtYQbKNMkvB0Nji8eGwHP6o=", "integrity": "sha1-lcHkMtYQbKNMkvB0Nji8eGwHP6o=",
"dev": true "dev": true
}, },
"@types/events": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/@types/events/-/events-1.2.0.tgz",
"integrity": "sha512-KEIlhXnIutzKwRbQkGWb/I4HFqBuUykAdHgDED6xqwXJfONCjF5VoE0cXEiurh3XauygxzeDzgtXUqvLkxFzzA==",
"dev": true
},
"@types/express": {
"version": "4.11.1",
"resolved": "https://registry.npmjs.org/@types/express/-/express-4.11.1.tgz",
"integrity": "sha512-ttWle8cnPA5rAelauSWeWJimtY2RsUf2aspYZs7xPHiWgOlPn6nnUfBMtrkcnjFJuIHJF4gNOdVvpLK2Zmvh6g==",
"dev": true,
"requires": {
"@types/body-parser": "1.16.8",
"@types/express-serve-static-core": "4.11.1",
"@types/serve-static": "1.13.1"
}
},
"@types/express-serve-static-core": {
"version": "4.11.1",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.11.1.tgz",
"integrity": "sha512-EehCl3tpuqiM8RUb+0255M8PhhSwTtLfmO7zBBdv0ay/VTd/zmrqDfQdZFsa5z/PVMbH2yCMZPXsnrImpATyIw==",
"dev": true,
"requires": {
"@types/events": "1.2.0",
"@types/node": "8.5.8"
}
},
"@types/mime": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.0.tgz",
"integrity": "sha512-A2TAGbTFdBw9azHbpVd+/FkdW2T6msN1uct1O9bH3vTerEHKZhTXJUQXy+hNq1B0RagfU8U+KBdqiZpxjhOUQA==",
"dev": true
},
"@types/moment": { "@types/moment": {
"version": "2.13.0", "version": "2.13.0",
"resolved": "https://registry.npmjs.org/@types/moment/-/moment-2.13.0.tgz", "resolved": "https://registry.npmjs.org/@types/moment/-/moment-2.13.0.tgz",
@ -58,6 +101,25 @@
"@types/node": "8.5.8" "@types/node": "8.5.8"
} }
}, },
"@types/serve-static": {
"version": "1.13.1",
"resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.1.tgz",
"integrity": "sha512-jDMH+3BQPtvqZVIcsH700Dfi8Q3MIcEx16g/VdxjoqiGR/NntekB10xdBpirMKnPe9z2C5cBmL0vte0YttOr3Q==",
"dev": true,
"requires": {
"@types/express-serve-static-core": "4.11.1",
"@types/mime": "2.0.0"
}
},
"accepts": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz",
"integrity": "sha1-63d99gEXI6OxTopywIBcjoZ0a9I=",
"requires": {
"mime-types": "2.1.18",
"negotiator": "0.6.1"
}
},
"ansi-styles": { "ansi-styles": {
"version": "3.2.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz",
@ -74,6 +136,11 @@
"typical": "2.6.1" "typical": "2.6.1"
} }
}, },
"array-flatten": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
},
"async-limiter": { "async-limiter": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
@ -92,6 +159,23 @@
"readable-stream": "2.3.3" "readable-stream": "2.3.3"
} }
}, },
"body-parser": {
"version": "1.18.2",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.2.tgz",
"integrity": "sha1-h2eKGdhLR9hZuDGZvVm84iKxBFQ=",
"requires": {
"bytes": "3.0.0",
"content-type": "1.0.4",
"debug": "2.6.9",
"depd": "1.1.2",
"http-errors": "1.6.3",
"iconv-lite": "0.4.19",
"on-finished": "2.3.0",
"qs": "6.5.1",
"raw-body": "2.3.2",
"type-is": "1.6.16"
}
},
"brace-expansion": { "brace-expansion": {
"version": "1.1.8", "version": "1.1.8",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.8.tgz",
@ -101,6 +185,11 @@
"concat-map": "0.0.1" "concat-map": "0.0.1"
} }
}, },
"bytes": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
"integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg="
},
"callback-stream": { "callback-stream": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/callback-stream/-/callback-stream-1.1.0.tgz", "resolved": "https://registry.npmjs.org/callback-stream/-/callback-stream-1.1.0.tgz",
@ -167,6 +256,26 @@
"typedarray": "0.0.6" "typedarray": "0.0.6"
} }
}, },
"content-disposition": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
"integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ="
},
"content-type": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
"integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
},
"cookie": {
"version": "0.3.1",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
"integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
},
"cookie-signature": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
"integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
},
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
@ -180,6 +289,24 @@
"moment-timezone": "0.5.14" "moment-timezone": "0.5.14"
} }
}, },
"debug": {
"version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"requires": {
"ms": "2.0.0"
}
},
"depd": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
},
"destroy": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
},
"duplexify": { "duplexify": {
"version": "3.5.1", "version": "3.5.1",
"resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.1.tgz", "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.1.tgz",
@ -191,6 +318,16 @@
"stream-shift": "1.0.0" "stream-shift": "1.0.0"
} }
}, },
"ee-first": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
"integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
},
"encodeurl": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
"integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
},
"end-of-stream": { "end-of-stream": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.0.tgz",
@ -199,16 +336,77 @@
"once": "1.4.0" "once": "1.4.0"
} }
}, },
"escape-html": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
"integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
},
"escape-string-regexp": { "escape-string-regexp": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ="
}, },
"etag": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
"integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
},
"express": {
"version": "4.16.3",
"resolved": "https://registry.npmjs.org/express/-/express-4.16.3.tgz",
"integrity": "sha1-avilAjUNsyRuzEvs9rWjTSL37VM=",
"requires": {
"accepts": "1.3.5",
"array-flatten": "1.1.1",
"body-parser": "1.18.2",
"content-disposition": "0.5.2",
"content-type": "1.0.4",
"cookie": "0.3.1",
"cookie-signature": "1.0.6",
"debug": "2.6.9",
"depd": "1.1.2",
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"etag": "1.8.1",
"finalhandler": "1.1.1",
"fresh": "0.5.2",
"merge-descriptors": "1.0.1",
"methods": "1.1.2",
"on-finished": "2.3.0",
"parseurl": "1.3.2",
"path-to-regexp": "0.1.7",
"proxy-addr": "2.0.3",
"qs": "6.5.1",
"range-parser": "1.2.0",
"safe-buffer": "5.1.1",
"send": "0.16.2",
"serve-static": "1.13.2",
"setprototypeof": "1.1.0",
"statuses": "1.4.0",
"type-is": "1.6.16",
"utils-merge": "1.0.1",
"vary": "1.1.2"
}
},
"extend": { "extend": {
"version": "3.0.1", "version": "3.0.1",
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz",
"integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ="
}, },
"finalhandler": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz",
"integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==",
"requires": {
"debug": "2.6.9",
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"on-finished": "2.3.0",
"parseurl": "1.3.2",
"statuses": "1.4.0",
"unpipe": "1.0.0"
}
},
"find-replace": { "find-replace": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/find-replace/-/find-replace-1.0.3.tgz", "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-1.0.3.tgz",
@ -228,6 +426,16 @@
} }
} }
}, },
"forwarded": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
},
"fresh": {
"version": "0.5.2",
"resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
"integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
},
"fs.realpath": { "fs.realpath": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
@ -288,6 +496,22 @@
"xtend": "4.0.1" "xtend": "4.0.1"
} }
}, },
"http-errors": {
"version": "1.6.3",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
"integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
"requires": {
"depd": "1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.0",
"statuses": "1.4.0"
}
},
"iconv-lite": {
"version": "0.4.19",
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz",
"integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ=="
},
"inflight": { "inflight": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
@ -302,6 +526,11 @@
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
}, },
"ipaddr.js": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.6.0.tgz",
"integrity": "sha1-4/o1e3c9phnybpXwSdBVxyeW+Gs="
},
"is-absolute": { "is-absolute": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz", "resolved": "https://registry.npmjs.org/is-absolute/-/is-absolute-1.0.0.tgz",
@ -378,6 +607,39 @@
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.4.tgz",
"integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=" "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4="
}, },
"media-typer": {
"version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
"integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
},
"merge-descriptors": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
"integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
},
"methods": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
"integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
},
"mime": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz",
"integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ=="
},
"mime-db": {
"version": "1.33.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz",
"integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ=="
},
"mime-types": {
"version": "2.1.18",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz",
"integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==",
"requires": {
"mime-db": "1.33.0"
}
},
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
@ -435,11 +697,29 @@
"safe-buffer": "5.1.1" "safe-buffer": "5.1.1"
} }
}, },
"ms": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
},
"negotiator": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.1.tgz",
"integrity": "sha1-KzJxhOiZIQEXeyhWP7XnECrNDKk="
},
"nodemailer": { "nodemailer": {
"version": "4.4.1", "version": "4.4.1",
"resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-4.4.1.tgz", "resolved": "https://registry.npmjs.org/nodemailer/-/nodemailer-4.4.1.tgz",
"integrity": "sha512-1bnszJJXatcHJhLpxQ1XMkLDjCjPKvGKMtRQ73FOsoNln3UQjddEQmz6fAwM3aj0GtQ3dQX9qtMHPelz63GU7A==" "integrity": "sha512-1bnszJJXatcHJhLpxQ1XMkLDjCjPKvGKMtRQ73FOsoNln3UQjddEQmz6fAwM3aj0GtQ3dQX9qtMHPelz63GU7A=="
}, },
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
"requires": {
"ee-first": "1.1.1"
}
},
"once": { "once": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
@ -456,6 +736,11 @@
"readable-stream": "2.3.3" "readable-stream": "2.3.3"
} }
}, },
"parseurl": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz",
"integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M="
},
"path-dirname": { "path-dirname": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz",
@ -466,11 +751,25 @@
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18="
}, },
"path-to-regexp": {
"version": "0.1.7",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
"integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
},
"process-nextick-args": { "process-nextick-args": {
"version": "1.0.7", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz",
"integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=" "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M="
}, },
"proxy-addr": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.3.tgz",
"integrity": "sha512-jQTChiCJteusULxjBp8+jftSQE5Obdl3k4cnmLA6WXtK6XFuWRnvVL7aCiBqaLPM8c4ph0S4tKna8XvmIwEnXQ==",
"requires": {
"forwarded": "0.1.2",
"ipaddr.js": "1.6.0"
}
},
"pump": { "pump": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/pump/-/pump-2.0.0.tgz", "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.0.tgz",
@ -501,6 +800,50 @@
} }
} }
}, },
"qs": {
"version": "6.5.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz",
"integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A=="
},
"range-parser": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.0.tgz",
"integrity": "sha1-9JvmtIeJTdxA3MlKMi9hEJLgDV4="
},
"raw-body": {
"version": "2.3.2",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.2.tgz",
"integrity": "sha1-vNYMd9Prk83gBQKVw/N5OJvIj4k=",
"requires": {
"bytes": "3.0.0",
"http-errors": "1.6.2",
"iconv-lite": "0.4.19",
"unpipe": "1.0.0"
},
"dependencies": {
"depd": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.1.tgz",
"integrity": "sha1-V4O04cRZ8G+lyif5kfPQbnoxA1k="
},
"http-errors": {
"version": "1.6.2",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.2.tgz",
"integrity": "sha1-CgAsyFcHGSp+eUbO7cERVfYOxzY=",
"requires": {
"depd": "1.1.1",
"inherits": "2.0.3",
"setprototypeof": "1.0.3",
"statuses": "1.4.0"
}
},
"setprototypeof": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.0.3.tgz",
"integrity": "sha1-ZlZ+NwQ+608E2RvWWMDL77VbjgQ="
}
}
},
"readable-stream": { "readable-stream": {
"version": "2.3.3", "version": "2.3.3",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz",
@ -530,6 +873,42 @@
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz",
"integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=" "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM="
}, },
"send": {
"version": "0.16.2",
"resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz",
"integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==",
"requires": {
"debug": "2.6.9",
"depd": "1.1.2",
"destroy": "1.0.4",
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"etag": "1.8.1",
"fresh": "0.5.2",
"http-errors": "1.6.3",
"mime": "1.4.1",
"ms": "2.0.0",
"on-finished": "2.3.0",
"range-parser": "1.2.0",
"statuses": "1.4.0"
}
},
"serve-static": {
"version": "1.13.2",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz",
"integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==",
"requires": {
"encodeurl": "1.0.2",
"escape-html": "1.0.3",
"parseurl": "1.3.2",
"send": "0.16.2"
}
},
"setprototypeof": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz",
"integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ=="
},
"simple-node-logger": { "simple-node-logger": {
"version": "0.93.33", "version": "0.93.33",
"resolved": "https://registry.npmjs.org/simple-node-logger/-/simple-node-logger-0.93.33.tgz", "resolved": "https://registry.npmjs.org/simple-node-logger/-/simple-node-logger-0.93.33.tgz",
@ -547,6 +926,11 @@
"through2": "2.0.3" "through2": "2.0.3"
} }
}, },
"statuses": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz",
"integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew=="
},
"stream-shift": { "stream-shift": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz",
@ -614,6 +998,15 @@
"is-negated-glob": "1.0.0" "is-negated-glob": "1.0.0"
} }
}, },
"type-is": {
"version": "1.6.16",
"resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.16.tgz",
"integrity": "sha512-HRkVv/5qY2G6I8iab9cI7v1bOIdhm94dVjQCPFElW9W+3GeDOSHmy2EBYe4VTApuzolPcmgFTN3ftVJRKR2J9Q==",
"requires": {
"media-typer": "0.3.0",
"mime-types": "2.1.18"
}
},
"typedarray": { "typedarray": {
"version": "0.0.6", "version": "0.0.6",
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
@ -649,11 +1042,26 @@
"through2-filter": "2.0.0" "through2-filter": "2.0.0"
} }
}, },
"unpipe": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
"integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
},
"util-deprecate": { "util-deprecate": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8="
}, },
"utils-merge": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
"integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
},
"websocket-stream": { "websocket-stream": {
"version": "5.1.1", "version": "5.1.1",
"resolved": "https://registry.npmjs.org/websocket-stream/-/websocket-stream-5.1.1.tgz", "resolved": "https://registry.npmjs.org/websocket-stream/-/websocket-stream-5.1.1.tgz",

View File

@ -19,15 +19,19 @@
}, },
"homepage": "https://gitlab.com/wolutator/dispatcher_ng#README", "homepage": "https://gitlab.com/wolutator/dispatcher_ng#README",
"dependencies": { "dependencies": {
"body-parser": "^1.18.2",
"chalk": "^2.3.0", "chalk": "^2.3.0",
"command-line-args": "^4.0.7", "command-line-args": "^4.0.7",
"cron": "^1.3.0", "cron": "^1.3.0",
"express": "^4.16.3",
"moment": "^2.20.1", "moment": "^2.20.1",
"mqtt": "^2.15.0", "mqtt": "^2.15.0",
"nodemailer": "^4.4.1", "nodemailer": "^4.4.1",
"simple-node-logger": "^0.93.33" "simple-node-logger": "^0.93.33"
}, },
"devDependencies": { "devDependencies": {
"@types/body-parser": "^1.16.8",
"@types/express": "^4.11.1",
"@types/chalk": "^2.2.0", "@types/chalk": "^2.2.0",
"@types/command-line-args": "^4.0.2", "@types/command-line-args": "^4.0.2",
"@types/cron": "^1.2.1", "@types/cron": "^1.2.1",

64
src/GeoFences.ts Normal file
View File

@ -0,0 +1,64 @@
import * as http from 'http'
import * as express from 'express'
import * as logger from './log'
import * as bodyParser from 'body-parser'
import * as config from './config'
import { mqttHandler } from './MqttDispatcher'
import { EventEmitter } from 'events';
export type AttendanceSheetType = { [index: string]: boolean }
export class GeoFences extends EventEmitter {
private app: express.Express
private server: http.Server
public attendanceSheet : AttendanceSheetType
static geoFencesTopicPre : string = "dispatcher_ng/geofences"
constructor() {
super()
this.app = express()
this.app.use(bodyParser.urlencoded({ extended: false }));
this.app.use(bodyParser.json());
this.attendanceSheet = {}
}
exec() : void {
this.app.post('/', (req: express.Request , res: express.Response) => {
const reqData = req.body
const deviceId = reqData.device
let occupantName : string = 'unknown'
const location = reqData.name
if (deviceId in config.dict.occupants) {
occupantName = config.dict.occupants[deviceId]
}
const presence : boolean = reqData.entry == '1'
const direction : string = presence ? 'arrives at' : 'leaves from'
logger.info(`${deviceId} (${occupantName}) ${direction} ${location}`)
logger.info(JSON.stringify(reqData))
res.send('OK')
const state : string = presence ? 'present' : 'absent'
mqttHandler.send(`${GeoFences.geoFencesTopicPre}/${occupantName}`, state)
this.attendanceSheet[occupantName] = presence
//logger.info(`attendanceSheet is now ${JSON.stringify(this.attendanceSheet)}`)
this.emit('change', this.attendanceSheet)
})
let port = parseInt(config.dict.geofencesPort)
this.server = this.app.listen(port, '', () => {
logger.info(`geofences server listening on ${port}`)
})
}
}

View File

@ -1,16 +0,0 @@
import { Forwarder } from './Forwarder'
import { HasInTopic } from './AItem'
export class HeatingScene extends Forwarder {
constructor(floor: string, room: string, item: string, label: string,
targetItems: HasInTopic[]) {
let inTopics: string[] = []
targetItems.forEach((item: HasInTopic) => {
inTopics.push(item.getInTopic())
})
super(floor, room, item, "command", label, inTopics)
}
}

View File

@ -81,23 +81,20 @@ export class MaxThermostat extends AHomegearItem implements HasInTopic {
this.temperature = parseFloat(payload) this.temperature = parseFloat(payload)
setTemperature = true setTemperature = true
} else if (topic == this.commandTopic) { } else if (topic == this.commandTopic) {
if ((payload == 'ON') && this.heatingMainFlag) { if (this.heatingMainFlag) {
if (payload == 'ON') {
this.temperature = this.presetTemperature this.temperature = this.presetTemperature
setTemperature = true
} else if (payload == 'OFF') { } else if (payload == 'OFF') {
this.temperature = DISABLED_TEMPERATURE this.temperature = DISABLED_TEMPERATURE
setTemperature = true }
} else if (payload == 'FORCE_ON') {
this.temperature = this.presetTemperature
setTemperature = true setTemperature = true
} }
} else if (topic == MaxThermostat.heatingMainSwitchTopic) { } else if (topic == MaxThermostat.heatingMainSwitchTopic) {
this.heatingMainFlag = (payload == 'ON') this.heatingMainFlag = (payload == 'ON')
logger.info(`${this.itemId} heating main: ${this.heatingMainFlag}`) logger.info(`${this.itemId} heating main: ${this.heatingMainFlag}`)
if (! this.heatingMainFlag) { if (! this.heatingMainFlag) {
this.temperature = DISABLED_TEMPERATURE mqttHandler.send(this.temperatureFeedbackTopic, `${DISABLED_TEMPERATURE}`)
mqttHandler.send(this.temperatureFeedbackTopic, `${this.temperature}`) mqttHandler.send(this.actionTopic, `${DISABLED_TEMPERATURE}`)
mqttHandler.send(this.actionTopic, `${this.temperature}`)
} }
} else if (topic == this.presetTemperatureTopic) { } else if (topic == this.presetTemperatureTopic) {
this.presetTemperature = parseFloat(payload) this.presetTemperature = parseFloat(payload)

View File

@ -4,7 +4,7 @@ import * as config from './config'
import * as logger from './log' import * as logger from './log'
import { mqttHandler } from './MqttDispatcher' import { mqttHandler } from './MqttDispatcher'
import { AItem, HasInTopic } from './AItem' import { AItem } from './AItem'
import { HomekitExportType, ExportType } from './Export' import { HomekitExportType, ExportType } from './Export'
import { M433SwitchItem } from './M433SwitchItem' import { M433SwitchItem } from './M433SwitchItem'
import { HomematicFourButtonThing, HomematicFourButtonSingleItem } from './HomematicFourButtonThing' import { HomematicFourButtonThing, HomematicFourButtonSingleItem } from './HomematicFourButtonThing'
@ -22,13 +22,13 @@ import { Cron } from './Cron'
import { HueColorBulbItem } from './HueColorBulbItem' import { HueColorBulbItem } from './HueColorBulbItem'
import { TouchSwitchMultiButtonThing, TouchSwitchButtonSingleItem } from './TouchSwitchMultiButtonThing' import { TouchSwitchMultiButtonThing, TouchSwitchButtonSingleItem } from './TouchSwitchMultiButtonThing'
import { RelayBoxThing } from './RelayBox' import { RelayBoxThing } from './RelayBox'
import { HeatingScene } from './HeatingScene' import { GeoFences, AttendanceSheetType } from './GeoFences'
logger.info("Dispatcher starting") logger.info("Dispatcher starting")
let allLabeledItems : Array<AItem> = new Array() let allLabeledItems : Array<AItem> = new Array()
let allThermostatItems : Array<HasInTopic> = new Array()
// Anna ----------------------------------------------------------------------------------------------------- // Anna -----------------------------------------------------------------------------------------------------
// Anna Aquarium 14665044 24 1 14665041 24 1 // Anna Aquarium 14665044 24 1 14665041 24 1
@ -61,8 +61,6 @@ let thermostatAnna1st = new MaxThermostat('1st', 'Anna', 'Thermostat', 'Thermost
thermostatAnna1st.start() thermostatAnna1st.start()
thermostatAnna1st.setPresetTemperature(21.0) thermostatAnna1st.setPresetTemperature(21.0)
allLabeledItems.push(thermostatAnna1st) allLabeledItems.push(thermostatAnna1st)
allThermostatItems.push(thermostatAnna1st)
let thermostatAnna1stCron = new Cron('thermostatAnna1stCron', thermostatAnna1st, [ let thermostatAnna1stCron = new Cron('thermostatAnna1stCron', thermostatAnna1st, [
{cronTime: '00 05 06 * * *', output: 'ON'}, {cronTime: '00 05 06 * * *', output: 'ON'},
@ -92,10 +90,6 @@ let matthiasSpeaker = new M433SwitchItem('1st', 'Matthias', 'Speaker', 'Lautspre
matthiasSpeaker.start() matthiasSpeaker.start()
allLabeledItems.push(matthiasSpeaker) allLabeledItems.push(matthiasSpeaker)
let windowContactMatthias = new MaxWindowContact('1st', 'Matthias', 'WindowContact', 'Fenster', 24)
windowContactMatthias.start()
allLabeledItems.push(windowContactMatthias)
// Esszimmer ------------------------------------------------------------------------------------------------ // Esszimmer ------------------------------------------------------------------------------------------------
// Esszimmer kleine Lampe 69653 24 1 69652 24 1 // Esszimmer kleine Lampe 69653 24 1 69652 24 1
let diningRoomSmallLight = new M433SwitchItem('Gnd', 'DiningRoom', 'SmallLight', 'kleine Lampe Esszimmer', '69653 24 1', '69652 24 1') let diningRoomSmallLight = new M433SwitchItem('Gnd', 'DiningRoom', 'SmallLight', 'kleine Lampe Esszimmer', '69653 24 1', '69652 24 1')
@ -215,7 +209,6 @@ let thermostatBedroom1st = new MaxThermostat('1st', 'Bedroom', 'Thermostat', 'Th
thermostatBedroom1st.start() thermostatBedroom1st.start()
thermostatBedroom1st.setPresetTemperature(20.0) thermostatBedroom1st.setPresetTemperature(20.0)
allLabeledItems.push(thermostatBedroom1st) allLabeledItems.push(thermostatBedroom1st)
allThermostatItems.push(thermostatBedroom1st)
let thermostatBedroom1stCron = new Cron('thermostatBedroom1stCron', thermostatBedroom1st, [ let thermostatBedroom1stCron = new Cron('thermostatBedroom1stCron', thermostatBedroom1st, [
{cronTime: '00 01 06 * * 1-5', output: 'ON'}, {cronTime: '00 01 06 * * 1-5', output: 'ON'},
@ -279,7 +272,6 @@ let thermostatBathroomGnd = new MaxThermostat('Gnd', 'Bathroom', 'Thermostat', '
thermostatBathroomGnd.start() thermostatBathroomGnd.start()
thermostatBathroomGnd.setPresetTemperature(20.0) thermostatBathroomGnd.setPresetTemperature(20.0)
allLabeledItems.push(thermostatBathroomGnd) allLabeledItems.push(thermostatBathroomGnd)
allThermostatItems.push(thermostatBathroomGnd)
let thermostatBathroomGndCron = new Cron('thermostatBathroomGndCron', thermostatBathroomGnd, [ let thermostatBathroomGndCron = new Cron('thermostatBathroomGndCron', thermostatBathroomGnd, [
{cronTime: '00 02 06 * * 1-5', output: 'ON'}, {cronTime: '00 02 06 * * 1-5', output: 'ON'},
@ -299,7 +291,6 @@ let thermostatBathroom1st = new MaxThermostat('1st', 'Bathroom', 'Thermostat', '
thermostatBathroom1st.start() thermostatBathroom1st.start()
thermostatBathroom1st.setPresetTemperature(20.0) thermostatBathroom1st.setPresetTemperature(20.0)
allLabeledItems.push(thermostatBathroom1st) allLabeledItems.push(thermostatBathroom1st)
allThermostatItems.push(thermostatBathroom1st)
let thermostatBathroom1stCron = new Cron('thermostatBathroom1stCron', thermostatBathroom1st, [ let thermostatBathroom1stCron = new Cron('thermostatBathroom1stCron', thermostatBathroom1st, [
{cronTime: '00 00 06 * * 1-5', output: 'ON'}, {cronTime: '00 00 06 * * 1-5', output: 'ON'},
@ -330,7 +321,6 @@ let thermostatKitchen = new MaxThermostat('Gnd', 'Kitchen', 'Thermostat', 'Therm
thermostatKitchen.start() thermostatKitchen.start()
thermostatKitchen.setPresetTemperature(20.0) thermostatKitchen.setPresetTemperature(20.0)
allLabeledItems.push(thermostatKitchen) allLabeledItems.push(thermostatKitchen)
allThermostatItems.push(thermostatKitchen)
let thermostatKitchenCron = new Cron('thermostatKitchenCron', thermostatKitchen, [ let thermostatKitchenCron = new Cron('thermostatKitchenCron', thermostatKitchen, [
{cronTime: '00 00 06 * * 1-5', output: 'ON'}, {cronTime: '00 00 06 * * 1-5', output: 'ON'},
@ -355,11 +345,13 @@ let relayBox = new RelayBoxThing('base', 'labor', 'relaybox', 'IoT/Command/Relay
relayBox.start() relayBox.start()
allLabeledItems.push(relayBox) allLabeledItems.push(relayBox)
// ---------------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------------
let heatingSceneAll = new HeatingScene('Gnd', 'House', 'Heatings', 'Alle Heizungen', allThermostatItems) let geoFences = new GeoFences()
heatingSceneAll.start() geoFences.exec()
geoFences.on('change', (attendanceSheet: AttendanceSheetType) => {
logger.info(`geoFences change event: ${JSON.stringify(attendanceSheet)}`)
})
// ---------------------------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------------------------
let testFourButton = new HomematicFourButtonThing('Gnd', 'Hallway', 'TestButton', 9, [ let testFourButton = new HomematicFourButtonThing('Gnd', 'Hallway', 'TestButton', 9, [
new HomematicFourButtonSingleItem('dispatcher_ng/items/Gnd/Hallway/Testlight/dimmerIn'), new HomematicFourButtonSingleItem('dispatcher_ng/items/Gnd/Hallway/Testlight/dimmerIn'),