relaybox status handling

This commit is contained in:
2018-03-27 20:54:27 +02:00
parent 71f00fdf31
commit bd4bced0c0
2 changed files with 6 additions and 0 deletions

View File

@ -27,6 +27,9 @@ export class RelayBoxThing extends AItem {
logger.info(`RT: ${topic}, ${payload}`)
if (topic == this.deviceStatusTopic) {
logger.info(`RT: status received`)
let status : any = JSON.parse(payload)
let statusParsed: string = JSON.stringify(status)
logger.info(`RT: status parsed: ${statusParsed}`)
} else {
let thingRelatedPart = topic.substring(this.stateTopicPre.length+1)
let itemIdx = parseInt(thingRelatedPart)