forked from ToddGreenfield/homebridge-onkyo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RxTypes.js
39 lines (34 loc) · 1.24 KB
/
RxTypes.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
var inherits = require('util').inherits;
var Service, Characteristic;
module.exports = function(homebridge) {
Service = homebridge.hap.Service;
Characteristic = homebridge.hap.Characteristic;
UUID = homebridge.hap.uuid;
var RxTypes = {};
// Custom homekit characteristic for InputSource.
RxTypes.InputSource = function() {
var serviceUUID = UUID.generate('RxTypes:usagedevice:InputSource');
Characteristic.call(this, 'Input Source', serviceUUID);
this.setProps({
format: Characteristic.Formats.UINT8,
maxValue: 36,
minValue: 0,
minStep: 1,
perms: [ Characteristic.Perms.READ, Characteristic.Perms.WRITE, Characteristic.Perms.NOTIFY ]
});
this.value = this.getDefaultValue();
};
inherits(RxTypes.InputSource, Characteristic);
// Custom homekit characteristic for InputLabel.
RxTypes.InputLabel = function() {
var serviceUUID = UUID.generate('RxTypes:usagedevice:InputLabel');
Characteristic.call(this, 'Input Label', serviceUUID);
this.setProps({
format: Characteristic.Formats.String,
perms: [ Characteristic.Perms.READ, Characteristic.Perms.NOTIFY ]
});
this.value = this.getDefaultValue();
};
inherits(RxTypes.InputLabel, Characteristic);
return RxTypes;
};