contact export
This commit is contained in:
@ -32,7 +32,7 @@ export function ThermostatExport(itemId: string, label: string, temperatureTopic
|
||||
}
|
||||
|
||||
export function ContactExport(itemId: string, label: string, status: string) : ExportType {
|
||||
return {'homekit': ContactHomekitExport(itemId, label, status), 'openhab': ''}
|
||||
return {'homekit': ContactHomekitExport(itemId, label, status), 'openhab': ContactOpenHABExport(itemId, label, status)}
|
||||
}
|
||||
|
||||
export function HueColorLightExport(itemId: string, label: string,
|
||||
@ -120,6 +120,11 @@ function SwitchOpenHABExport(id: string, label: string, setOn: string, statusOn:
|
||||
return `Switch ${id} {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]"}`
|
||||
}
|
||||
|
||||
function ThermostatOpenHAPExport(id: string, label: string, setTemperature: string, statusTemperature: string) : string {
|
||||
return `Number ${id} {mqtt=">[localbroker:${setTemperature}:command:*:default],<[localbroker:${statusTemperature}:state:default]"}`
|
||||
}
|
||||
|
Reference in New Issue
Block a user