relaybox status handling
This commit is contained in:
3
dist/RelayBox.js
vendored
3
dist/RelayBox.js
vendored
@ -19,6 +19,9 @@ class RelayBoxThing extends AItem_1.AItem {
|
|||||||
logger.info(`RT: ${topic}, ${payload}`);
|
logger.info(`RT: ${topic}, ${payload}`);
|
||||||
if (topic == this.deviceStatusTopic) {
|
if (topic == this.deviceStatusTopic) {
|
||||||
logger.info(`RT: status received`);
|
logger.info(`RT: status received`);
|
||||||
|
let status = JSON.parse(payload);
|
||||||
|
let statusParsed = JSON.stringify(status);
|
||||||
|
logger.info(`RT: status parsed: ${statusParsed}`);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let thingRelatedPart = topic.substring(this.stateTopicPre.length + 1);
|
let thingRelatedPart = topic.substring(this.stateTopicPre.length + 1);
|
||||||
|
@ -27,6 +27,9 @@ export class RelayBoxThing extends AItem {
|
|||||||
logger.info(`RT: ${topic}, ${payload}`)
|
logger.info(`RT: ${topic}, ${payload}`)
|
||||||
if (topic == this.deviceStatusTopic) {
|
if (topic == this.deviceStatusTopic) {
|
||||||
logger.info(`RT: status received`)
|
logger.info(`RT: status received`)
|
||||||
|
let status : any = JSON.parse(payload)
|
||||||
|
let statusParsed: string = JSON.stringify(status)
|
||||||
|
logger.info(`RT: status parsed: ${statusParsed}`)
|
||||||
} else {
|
} else {
|
||||||
let thingRelatedPart = topic.substring(this.stateTopicPre.length+1)
|
let thingRelatedPart = topic.substring(this.stateTopicPre.length+1)
|
||||||
let itemIdx = parseInt(thingRelatedPart)
|
let itemIdx = parseInt(thingRelatedPart)
|
||||||
|
Reference in New Issue
Block a user