Skip to content

Instantly share code, notes, and snippets.

@itsmepetrov
Last active March 3, 2019 19:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save itsmepetrov/046bcdc449167723f0ddf5fcba14613b to your computer and use it in GitHub Desktop.
Save itsmepetrov/046bcdc449167723f0ddf5fcba14613b to your computer and use it in GitHub Desktop.
const HomeKitDevice = require('../HomeKitDevice')
class GledoptoLedController extends HomeKitDevice {
static get description() {
return {
model: [
'GLEDOPTO',
],
manufacturer: 'GLEDOPTO',
name: 'GLEDOPTO Led Controller',
}
}
getAvailbleServices() {
return [{
name: 'Bulb',
type: 'Lightbulb',
}]
}
onDeviceReady() {
this.mountServiceCharacteristic({
endpoint: 11,
cluster: 'genOnOff',
service: 'Bulb',
characteristic: 'On',
reportMinInt: 1,
reportMaxInt: 300,
reportChange: 1,
parser: 'onOff',
})
this.mountServiceCharacteristic({
endpoint: 11,
cluster: 'genLevelCtrl',
service: 'Bulb',
characteristic: 'Brightness',
reportMinInt: 1,
reportMaxInt: 300,
reportChange: 1,
parser: 'dim',
})
}
}
module.exports = GledoptoLedController
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment