Created
November 5, 2017 11:16
-
-
Save fredericbarthelet/8cc64c508871265ee7f5b3c4e5ebb9ea 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
mySwitch.prototype = { | |
getServices: function () { | |
let informationService = new Service.AccessoryInformation(); | |
informationService | |
.setCharacteristic(Characteristic.Manufacturer, “My switch manufacturer”) | |
.setCharacteristic(Characteristic.Model, “My switch model”) | |
.setCharacteristic(Characteristic.SerialNumber, “123–456–789”); | |
let switchService = new Service.Switch(“My switch”); | |
switchService | |
.getCharacteristic(Characteristic.On) | |
.on(‘get’, this.getSwitchOnCharacteristic.bind(this)) | |
.on(‘set’, this.setSwitchOnCharacteristic.bind(this)); | |
this.informationService = informationService; | |
this.switchService = switchService; | |
return [informationService, switchService]; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment