-
-
Save Koenkk/16f00544fb7e46f6681495363dfad078 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Example { | |
/** | |
* Besides intializing variables, the constructor should do nothing! | |
* | |
* @param {Zigbee} zigbee Zigbee controller | |
* @param {MQTT} mqtt MQTT controller | |
* @param {State} state State controller | |
* @param {Function} publishEntityState Method to publish device state to MQTT. | |
* @param {EventBus} eventBus The event bus | |
*/ | |
constructor(zigbee, mqtt, state, publishEntityState, eventBus) { | |
this.zigbee = zigbee; | |
this.mqtt = mqtt; | |
this.state = state; | |
this.publishEntityState = publishEntityState; | |
this.eventBus = eventBus; | |
} | |
/** | |
* This method is called by the controller once Zigbee has been started. | |
*/ | |
onZigbeeStarted() { | |
console.log('Zigbee started'); | |
} | |
/** | |
* This method is called by the controller once connected to the MQTT server. | |
*/ | |
// onMQTTConnected() {} | |
/** | |
* Is called when a Zigbee message from a device is received. | |
* @param {string} type Type of the message | |
* @param {Object} data Data of the message | |
* @param {Object?} resolvedEntity Resolved entity returned from this.zigbee.resolveEntity() | |
*/ | |
onZigbeeEvent(type, data, resolvedEntity) { | |
} | |
/** | |
* Is called when a MQTT message is received | |
* @param {string} topic Topic on which the message was received | |
* @param {Object} message The received message | |
* @return {boolean} if the message was handled | |
*/ | |
onMQTTMessage(topic, message) { | |
return false; | |
} | |
/** | |
* Is called once the extension has to stop | |
*/ | |
stop() { | |
} | |
} | |
module.exports = Example; |
No, the doc string was incorrect :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is the onZigbeeEvent missing a parameter that is mentioned in the docstring? I'll have a play with this next weekend :)