This commit is contained in:
Wolfgang Hottgenroth
2018-01-27 17:58:18 +01:00
parent 3002b01788
commit c4ab32a229
7 changed files with 183 additions and 7 deletions

33
dist/Export.js vendored
View File

@ -24,6 +24,10 @@ function ContactExport(itemId, label, status) {
return { 'homekit': ContactHomekitExport(itemId, label, status), 'openhab': '' };
}
exports.ContactExport = ContactExport;
function HueColorLightExport(itemId, label, stateTopic, stateFeedbackTopic, brightnessTopic, brightnessFeedbackTopic, hueTopic, hueFeedbackTopic, saturationTopic, saturationFeedbackTopic, colorTemperatureTopic, colorTemperatureFeedbackTopic) {
return { 'homekit': HueColorLightHomekitExport(itemId, label, stateTopic, stateFeedbackTopic, brightnessTopic, brightnessFeedbackTopic, hueTopic, hueFeedbackTopic, saturationTopic, saturationFeedbackTopic, colorTemperatureTopic, colorTemperatureFeedbackTopic), 'openhab': '' };
}
exports.HueColorLightExport = HueColorLightExport;
function SwitchHomekitBulbExport(id, label, setOn, statusOn) {
let o = {
"id": id,
@ -93,4 +97,33 @@ function SwitchOpenHABExport(id, label, setOn, statusOn) {
// Switch windowLightKitchen {mqtt=">[localbroker:nodered/items/windowLightKitchen:command:*:default]", mqtt="<[localbroker:nodered/items/windowLightKitchen/feedback:state:default]"}
return `Switch ${id} {mqtt=">[localbroker:${setOn}:command:*:default],<[localbroker:${statusOn}:state:default]"}`;
}
function HueColorLightHomekitExport(id, label, stateTopic, stateFeedbackTopic, brightnessTopic, brightnessFeedbackTopic, hueTopic, hueFeedbackTopic, saturationTopic, saturationFeedbackTopic, colorTemperatureTopic, colorTemperatureFeedbackTopic) {
let o = {
"id": id,
"name": label,
"service": "Lightbulb",
"manufacturer": "hue2mqtt - Hue",
"model": "color light",
"topic": {
"setOn": stateTopic,
"statusOn": stateFeedbackTopic,
"setBrightness": brightnessTopic,
"statusBrightness": brightnessFeedbackTopic,
"setHue": hueTopic,
"statusHue": hueFeedbackTopic,
"setSaturation": saturationTopic,
"statusSaturation": saturationFeedbackTopic,
"setColorTemperature": colorTemperatureTopic,
"statusColorTemperature": colorTemperatureFeedbackTopic
},
"payload": {
"onTrue": "ON",
"onFalse": "OFF",
"brightnessFactor": 1,
"hueFactor": 1,
"saturationFactor": 1
}
};
return { 'id': id, 'object': o };
}
//# sourceMappingURL=Export.js.map