Created
December 11, 2018 21:20
-
-
Save itsmepetrov/6df7be02616ded7edc34b1598642c8ee 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
const HomeKitDevice = require('../HomeKitDevice') | |
class IkeaTradfriDimmableBulb extends HomeKitDevice { | |
static get description() { | |
return { | |
model: [ | |
'TRADFRI bulb E27 opal 1000lm', | |
'TRADFRI bulb E27 W opal 1000lm', | |
], | |
manufacturer: 'IKEA of Sweden', | |
name: 'IKEA TRADFRI', | |
} | |
} | |
getAvailbleServices() { | |
return [{ | |
name: 'Bulb', | |
type: 'Lightbulb', | |
}] | |
} | |
onDeviceReady() { | |
this.mountServiceCharacteristic({ | |
endpoint: 1, | |
cluster: 'genOnOff', | |
service: 'Bulb', | |
characteristic: 'On', | |
reportMinInt: 1, | |
reportMaxInt: 300, | |
reportChange: 1, | |
parser: 'onOff', | |
}) | |
this.mountServiceCharacteristic({ | |
endpoint: 1, | |
cluster: 'genLevelCtrl', | |
service: 'Bulb', | |
characteristic: 'Brightness', | |
reportMinInt: 1, | |
reportMaxInt: 300, | |
reportChange: 1, | |
parser: 'dim', | |
}) | |
} | |
} | |
module.exports = IkeaTradfriDimmableBulb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment