export stuff

This commit is contained in:
Wolfgang Hottgenroth
2018-04-02 23:03:10 +02:00
parent d586ab6860
commit e883c9a791
6 changed files with 81 additions and 63 deletions

View File

@ -132,16 +132,16 @@ function ContactHomekitExport(id: string, label: string, status: string) : Homek
function SwitchOpenHABExport(id: string, label: string, setOn: string, statusOn: string): string {
// 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]"}`
return `Switch ${id} "${label}"{mqtt=">[localbroker:${setOn}:command:*:default],<[localbroker:${statusOn}:state:default]"}`
}
function ContactOpenHABExport(id: string, label: string, status: string): string {
// Switch windowLightKitchen {mqtt=">[localbroker:nodered/items/windowLightKitchen:command:*:default]", mqtt="<[localbroker:nodered/items/windowLightKitchen/feedback:state:default]"}
return `Switch ${id} {mqtt="<[localbroker:${status}:state:default]"}`
return `Contact ${id} "${label}" {mqtt="<[localbroker:${status}:state:default]"}`
}
function ThermostatOpenHAPExport(id: string, label: string, setTemperature: string, statusTemperature: string) : string {
return `Number ${id} {mqtt=">[localbroker:${setTemperature}:command:*:default],<[localbroker:${statusTemperature}:state:default]"}`
return `Number ${id} "${label}" {mqtt=">[localbroker:${setTemperature}:command:*:default],<[localbroker:${statusTemperature}:state:default]"}`
}
function HueColorLightHomekitExport(id: string, label: string,
@ -177,4 +177,4 @@ function HueColorLightHomekitExport(id: string, label: string,
}
}
return { 'id': id, 'object': o}
}
}