fix SimpleTopic and remove homekit and openhab stuff

This commit is contained in:
Wolfgang Hottgenroth
2018-07-11 20:35:55 +02:00
parent 3dc256f960
commit ceeecf5009
5 changed files with 9 additions and 68 deletions

View File

@ -57,9 +57,9 @@ export class SimpleTopicSwitchItem extends AItem implements HasStateAndFeedbackT
mqttHandler.send(this.stateFeedbackTopic, this.state)
if (this.state != this.oldState) {
if (this.state == 'ON') {
mqttHandler.send(this.actionTopic, 'true')
mqttHandler.send(this.actionTopic, 'ON')
} else {
mqttHandler.send(this.actionTopic, 'false')
mqttHandler.send(this.actionTopic, 'OFF')
}
this.oldState = this.state
}

View File

@ -598,40 +598,6 @@ let watchdogTimer = setInterval(() => {
// ----------------------------------------------------------------------------------------------------------
// Homekit export
let homekitObject : { [key:string]:{} } = {}
let openhabList : string[] = []
// logger.info("allLabeledItems")
// logger.info(JSON.stringify(allLabeledItems))
allLabeledItems.forEach((item: AItem) => {
let exportData : ExportType|null = item.exportItem()
if (exportData != null) {
if ('id' in exportData['homekit']) {
homekitObject[exportData['homekit']['id']] = exportData['homekit']['object']
}
if (exportData['openhab'] instanceof Array) {
let da : string[] = exportData['openhab'] as string[]
da.forEach((o: string) => openhabList.push(o))
} else {
let da : string = exportData['openhab'] as string
openhabList.push(da)
}
// logger.info("openHabList")
// logger.info(JSON.stringify(openhabList))
}
})
let heatingMainSwitchExport : ExportType|null = MaxThermostat.exportHeatingMainSwitchItem()
if (heatingMainSwitchExport != null) {
let da : string = heatingMainSwitchExport['openhab'] as string
openhabList.push(da)
}
fs.writeFileSync(config.dict.homekitFile, JSON.stringify(homekitObject, null, 4))
fs.writeFileSync(config.dict.openhabItemFile, openhabList.join('\n'))
let roomSwitches: any = {}
allLights.forEach((item: HasStateAndFeedbackTopicAndLabelAndRoom) => {