-
-
Notifications
You must be signed in to change notification settings - Fork 629
/
HomeKit-Remote.ts
195 lines (138 loc) · 5.02 KB
/
HomeKit-Remote.ts
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
// manually created
import { Access, Characteristic, Formats, Perms } from '../Characteristic';
import { Service } from '../Service';
/**
* Characteristic "Target Control Supported Configuration"
*/
export class TargetControlSupportedConfiguration extends Characteristic {
static readonly UUID: string = '00000123-0000-1000-8000-0026BB765291';
constructor() {
super('Target Control Supported Configuration', TargetControlSupportedConfiguration.UUID);
this.setProps({
format: Formats.TLV8,
perms: [Perms.PAIRED_READ]
});
this.value = this.getDefaultValue();
}
}
Characteristic.TargetControlSupportedConfiguration = TargetControlSupportedConfiguration;
/**
* Characteristic "Target Control List"
*/
export class TargetControlList extends Characteristic {
static readonly UUID: string = '00000124-0000-1000-8000-0026BB765291';
constructor() {
super('Target Control List', TargetControlList.UUID);
this.setProps({
format: Formats.TLV8,
perms: [Perms.PAIRED_WRITE, Perms.PAIRED_READ, Perms.WRITE_RESPONSE],
adminOnlyAccess: [Access.READ, Access.WRITE],
});
this.value = this.getDefaultValue();
}
}
Characteristic.TargetControlList = TargetControlList;
/**
* Characteristic "Button Event"
*/
export class ButtonEvent extends Characteristic {
static readonly UUID: string = '00000126-0000-1000-8000-0026BB765291';
constructor() {
super('Button Event', ButtonEvent.UUID);
this.setProps({
format: Formats.TLV8,
perms: [Perms.PAIRED_READ, Perms.NOTIFY],
adminOnlyAccess: [Access.NOTIFY],
});
this.value = this.getDefaultValue();
}
}
Characteristic.ButtonEvent = ButtonEvent;
/**
* Characteristic "Selected Audio Stream Configuration"
*/
export class SelectedAudioStreamConfiguration extends Characteristic {
static readonly UUID: string = '00000128-0000-1000-8000-0026BB765291';
constructor() {
super('Selected Audio Stream Configuration', SelectedAudioStreamConfiguration.UUID);
this.setProps({
format: Formats.TLV8,
perms: [Perms.PAIRED_READ, Perms.PAIRED_WRITE]
});
this.value = this.getDefaultValue();
}
}
Characteristic.SelectedAudioStreamConfiguration = SelectedAudioStreamConfiguration;
/**
* Characteristic "Siri Input Type"
*/
export class SiriInputType extends Characteristic {
static readonly PUSH_BUTTON_TRIGGERED_APPLE_TV = 0;
static readonly UUID: string = '00000132-0000-1000-8000-0026BB765291';
constructor() {
super('Siri Input Type', SiriInputType.UUID);
this.setProps({
format: Formats.UINT8,
minValue: 0,
maxValue: 0,
validValues: [0],
perms: [Perms.PAIRED_READ]
});
this.value = this.getDefaultValue();
}
}
Characteristic.SiriInputType = SiriInputType;
/**
* Service "Target Control Management"
*/
export class TargetControlManagement extends Service {
static readonly UUID: string = '00000122-0000-1000-8000-0026BB765291';
constructor(displayName: string, subtype: string) {
super(displayName, TargetControlManagement.UUID, subtype);
// Required Characteristics
this.addCharacteristic(Characteristic.TargetControlSupportedConfiguration);
this.addCharacteristic(Characteristic.TargetControlList);
}
}
Service.TargetControlManagement = TargetControlManagement;
/**
* Service "Target Control"
*/
export class TargetControl extends Service {
static readonly UUID: string = '00000125-0000-1000-8000-0026BB765291';
constructor(displayName: string, subtype: string) {
super(displayName, TargetControl.UUID, subtype);
// Required Characteristics
this.addCharacteristic(Characteristic.ActiveIdentifier);
this.addCharacteristic(Characteristic.Active);
this.addCharacteristic(Characteristic.ButtonEvent);
// Optional Characteristics
this.addOptionalCharacteristic(Characteristic.Name);
}
}
Service.TargetControl = TargetControl;
/**
* Service "Audio Stream Management"
*/
export class AudioStreamManagement extends Service {
static readonly UUID: string = '00000127-0000-1000-8000-0026BB765291';
constructor(displayName: string, subtype: string) {
super(displayName, AudioStreamManagement.UUID, subtype);
// Required Characteristics
this.addCharacteristic(Characteristic.SupportedAudioStreamConfiguration);
this.addCharacteristic(Characteristic.SelectedAudioStreamConfiguration);
}
}
Service.AudioStreamManagement = AudioStreamManagement;
/**
* Service "Siri"
*/
export class Siri extends Service {
static readonly UUID: string = '00000133-0000-1000-8000-0026BB765291';
constructor(displayName: string, subtype: string) {
super(displayName, Siri.UUID, subtype);
// Required Characteristics
this.addCharacteristic(Characteristic.SiriInputType);
}
}
Service.Siri = Siri;