-
Notifications
You must be signed in to change notification settings - Fork 46
/
main.js
3314 lines (3162 loc) · 145 KB
/
main.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
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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/******/ (() => { // webpackBootstrap
/******/ "use strict";
/******/ var __webpack_modules__ = ({
/***/ "./main.ts":
/*!*****************!*\
!*** ./main.ts ***!
\*****************/
/***/ ((module, exports, __webpack_require__) => {
/* module decorator */ module = __webpack_require__.nmd(module);
/**
*
* iobroker.yahka adapter
*
*
* file io-package.json comments:
*
* {
* "common": {
* "name": "iobroker.yahka", // name has to be set and has to be equal to adapters folder name and main file name excluding extension
* "version": "0.0.0", // use "Semantic Versioning"! see http://semver.org/
* "title": "Node.js iobroker.yahka Adapter", // Adapter title shown in User Interfaces
* "authors": [ // Array of authord
* "name <[email protected]>"
* ]
* "desc": "iobroker.yahka adapter", // Adapter description shown in User Interfaces. Can be a language object {de:"...",ru:"..."} or a string
* "platform": "Javascript/Node.js", // possible values "javascript", "javascript/Node.js" - more coming
* "mode": "daemon", // possible values "daemon", "schedule", "subscribe"
* "schedule": "0 0 * * *" // cron-style schedule. Only needed if mode=schedule
* "loglevel": "info" // Adapters Log Level
* },
* "native": { // the native object is available via adapter.config in your adapters code - use it for configuration
* "test1": true,
* "test2": 42
* }
* }
*
*/
/* jshint -W097 */
/* jshint strict: false */
/* jslint node: true */
Object.defineProperty(exports, "__esModule", ({ value: true }));
const debug = __webpack_require__(/*! debug */ "debug");
debug.enable('EventedHTTPServer,HAPServer,Accessory,AccessoryLoader');
// you have to require the utils module and call adapter function
const utils = __webpack_require__(/*! @iobroker/adapter-core */ "@iobroker/adapter-core");
const hkAdapter = __webpack_require__(/*! ./yahka.ioBroker-adapter */ "./yahka.ioBroker-adapter.ts");
__webpack_require__(/*! ./yahka.functions/functions.import */ "./yahka.functions/functions.import.ts");
let yahkaAdapter;
function startAdapter(options = {}) {
const ioAdapter = utils.Adapter({ name: 'yahka', systemConfig: true });
yahkaAdapter = new hkAdapter.TIOBrokerAdapter(ioAdapter, utils.getAbsoluteDefaultDataDir());
return ioAdapter;
}
// ...
if (module && module.parent) {
// Export startAdapter in compact mode
module.exports = startAdapter;
}
else {
// Otherwise start the adapter immediately
startAdapter();
}
/***/ }),
/***/ "./shared/yahka.logger.ts":
/*!********************************!*\
!*** ./shared/yahka.logger.ts ***!
\********************************/
/***/ ((__unused_webpack_module, exports) => {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.YahkaLogger = void 0;
class YahkaLogger {
constructor(adapter, logIdentifier) {
this.adapter = adapter;
this.logIdentifier = logIdentifier;
}
debug(message) {
return this.adapter.log.debug(`[${this.logIdentifier}] ${message}`);
}
info(message) {
return this.adapter.log.info(`[${this.logIdentifier}] ${message}`);
}
warn(message) {
return this.adapter.log.warn(`[${this.logIdentifier}] ${message}`);
}
error(message) {
return this.adapter.log.error(`[${this.logIdentifier}] ${message}`);
}
}
exports.YahkaLogger = YahkaLogger;
/***/ }),
/***/ "./shared/yahka.utils.ts":
/*!*******************************!*\
!*** ./shared/yahka.utils.ts ***!
\*******************************/
/***/ ((__unused_webpack_module, exports) => {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.propertyExists = propertyExists;
function propertyExists(object, property) {
return property in object;
}
/***/ }),
/***/ "./yahka.community.types.ts":
/*!**********************************!*\
!*** ./yahka.community.types.ts ***!
\**********************************/
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.NotificationText = exports.NotificationCode = exports.VolatileOrganicCompoundPeakLevel = exports.VolatileOrganicCompoundLevel = exports.VolatileOrganicCompoundDetected = exports.SodiumDioxidePeakLevel = exports.SodiumDioxideLevel = exports.SodiumDioxideDetected = exports.OzonePeakLevel = exports.OzoneLevel = exports.OzoneDetected = exports.NitrogenDioxidePeakLevel = exports.NitrogenDioxideLevel = exports.NitrogenDioxideDetected = exports.AirFlow = exports.NoiseLevel = exports.AtmosphericPressureLevel = exports.EveResetTotal = exports.EveTimesOpened = exports.EveLastAction = exports.EveClosedDuration = exports.EveOpenDuration = exports.EveAirQuality = exports.BatteryLevel = exports.KilowattVoltAmpereHour = exports.KilowattHours = exports.VoltAmperes = exports.Watts = exports.Amperes = exports.Volts = exports.MediaHeight = exports.MediaWidth = exports.MediaTypeIdentifier = exports.StillImage = exports.MediaItemDuration = exports.MediaItemArtist = exports.MediaItemAlbumName = exports.MediaItemName = exports.MediaCurrentPosition = exports.PlaybackSpeed = exports.RepeatMode = exports.ShuffleMode = exports.SkipBackward = exports.SkipForward = exports.PlaybackState = exports.Muting = exports.AudioVolume = exports.VideoDataURL = exports.AudioDataURL = exports.Timestamp = void 0;
exports.NotificationService = exports.VolatileOrganicCompoundSensor = exports.SodiumDioxideSensor = exports.OzoneSensor = exports.NitrogenDioxideSensor = exports.AirFlowSensor = exports.NoiseLevelSensor = exports.AtmosphericPressureSensor = exports.SecurityCameraService = exports.StillImageService = exports.MediaInformationService = exports.PlaybackDeviceService = exports.AudioDeviceService = exports.UPSLoadPercent = exports.BatteryVoltageDC = exports.OutputVoltageAC = exports.InputVoltageAC = exports.DewPoint = exports.Latency = exports.Ping = exports.UploadSpeed = exports.DownloadSpeed = exports.LastEventTime = void 0;
exports.importHAPCommunityTypesAndFixes = importHAPCommunityTypesAndFixes;
const hap_nodejs_1 = __webpack_require__(/*! hap-nodejs */ "hap-nodejs");
let hapTypesImported = false;
function importHAPCommunityTypesAndFixes() {
if (hapTypesImported) {
return;
}
hap_nodejs_1.Characteristic[`Community: ${Timestamp.name}`] = Timestamp;
hap_nodejs_1.Characteristic[`Community: ${AudioDataURL.name}`] = AudioDataURL;
hap_nodejs_1.Characteristic[`Community: ${VideoDataURL.name}`] = VideoDataURL;
hap_nodejs_1.Characteristic[`Community: ${AudioVolume.name}`] = AudioVolume;
hap_nodejs_1.Characteristic[`Community: ${Muting.name}`] = Muting;
hap_nodejs_1.Characteristic[`Community: ${PlaybackState.name}`] = PlaybackState;
hap_nodejs_1.Characteristic[`Community: ${SkipForward.name}`] = SkipForward;
hap_nodejs_1.Characteristic[`Community: ${SkipBackward.name}`] = SkipBackward;
hap_nodejs_1.Characteristic[`Community: ${ShuffleMode.name}`] = ShuffleMode;
hap_nodejs_1.Characteristic[`Community: ${RepeatMode.name}`] = RepeatMode;
hap_nodejs_1.Characteristic[`Community: ${PlaybackSpeed.name}`] = PlaybackSpeed;
hap_nodejs_1.Characteristic[`Community: ${MediaCurrentPosition.name}`] = MediaCurrentPosition;
hap_nodejs_1.Characteristic[`Community: ${MediaItemName.name}`] = MediaItemName;
hap_nodejs_1.Characteristic[`Community: ${MediaItemAlbumName.name}`] = MediaItemAlbumName;
hap_nodejs_1.Characteristic[`Community: ${MediaItemArtist.name}`] = MediaItemArtist;
hap_nodejs_1.Characteristic[`Community: ${MediaItemDuration.name}`] = MediaItemDuration;
hap_nodejs_1.Characteristic[`Community: ${StillImage.name}`] = StillImage;
hap_nodejs_1.Characteristic[`Community: ${MediaTypeIdentifier.name}`] = MediaTypeIdentifier;
hap_nodejs_1.Characteristic[`Community: ${MediaWidth.name}`] = MediaWidth;
hap_nodejs_1.Characteristic[`Community: ${MediaHeight.name}`] = MediaHeight;
hap_nodejs_1.Characteristic[`Community: ${Volts.name}`] = Volts;
hap_nodejs_1.Characteristic[`Community: ${Amperes.name}`] = Amperes;
hap_nodejs_1.Characteristic[`Community: ${Watts.name}`] = Watts;
hap_nodejs_1.Characteristic[`Community: ${VoltAmperes.name}`] = VoltAmperes;
hap_nodejs_1.Characteristic[`Community: ${KilowattHours.name}`] = KilowattHours;
hap_nodejs_1.Characteristic[`Community: ${KilowattVoltAmpereHour.name}`] = KilowattVoltAmpereHour;
hap_nodejs_1.Characteristic[`Community: ${BatteryLevel.name}`] = BatteryLevel;
hap_nodejs_1.Characteristic[`Community: ${EveAirQuality.name}`] = EveAirQuality;
hap_nodejs_1.Characteristic[`Community: ${EveOpenDuration.name}`] = EveOpenDuration;
hap_nodejs_1.Characteristic[`Community: ${EveClosedDuration.name}`] = EveClosedDuration;
hap_nodejs_1.Characteristic[`Community: ${EveLastAction.name}`] = EveLastAction;
hap_nodejs_1.Characteristic[`Community: ${EveTimesOpened.name}`] = EveTimesOpened;
hap_nodejs_1.Characteristic[`Community: ${EveResetTotal.name}`] = EveResetTotal;
hap_nodejs_1.Characteristic[`Community: ${AtmosphericPressureLevel.name}`] = AtmosphericPressureLevel;
hap_nodejs_1.Characteristic[`Community: ${NoiseLevel.name}`] = NoiseLevel;
hap_nodejs_1.Characteristic[`Community: ${AirFlow.name}`] = AirFlow;
hap_nodejs_1.Characteristic[`Community: ${NitrogenDioxideDetected.name}`] = NitrogenDioxideDetected;
hap_nodejs_1.Characteristic[`Community: ${NitrogenDioxideLevel.name}`] = NitrogenDioxideLevel;
hap_nodejs_1.Characteristic[`Community: ${NitrogenDioxidePeakLevel.name}`] = NitrogenDioxidePeakLevel;
hap_nodejs_1.Characteristic[`Community: ${OzoneDetected.name}`] = OzoneDetected;
hap_nodejs_1.Characteristic[`Community: ${OzoneLevel.name}`] = OzoneLevel;
hap_nodejs_1.Characteristic[`Community: ${OzonePeakLevel.name}`] = OzonePeakLevel;
hap_nodejs_1.Characteristic[`Community: ${SodiumDioxideDetected.name}`] = SodiumDioxideDetected;
hap_nodejs_1.Characteristic[`Community: ${SodiumDioxideLevel.name}`] = SodiumDioxideLevel;
hap_nodejs_1.Characteristic[`Community: ${SodiumDioxidePeakLevel.name}`] = SodiumDioxidePeakLevel;
hap_nodejs_1.Characteristic[`Community: ${VolatileOrganicCompoundDetected.name}`] = VolatileOrganicCompoundDetected;
hap_nodejs_1.Characteristic[`Community: ${VolatileOrganicCompoundLevel.name}`] = VolatileOrganicCompoundLevel;
hap_nodejs_1.Characteristic[`Community: ${VolatileOrganicCompoundPeakLevel.name}`] = VolatileOrganicCompoundPeakLevel;
hap_nodejs_1.Characteristic[`Community: ${NotificationCode.name}`] = NotificationCode;
hap_nodejs_1.Characteristic[`Community: ${NotificationText.name}`] = NotificationText;
hap_nodejs_1.Characteristic[`Community: ${LastEventTime.name}`] = LastEventTime;
hap_nodejs_1.Characteristic[`Community: ${DownloadSpeed.name}`] = DownloadSpeed;
hap_nodejs_1.Characteristic[`Community: ${UploadSpeed.name}`] = UploadSpeed;
hap_nodejs_1.Characteristic[`Community: ${Ping.name}`] = Ping;
hap_nodejs_1.Characteristic[`Community: ${Latency.name}`] = Latency;
hap_nodejs_1.Characteristic[`Community: ${DewPoint.name}`] = DewPoint;
hap_nodejs_1.Characteristic[`Community: ${InputVoltageAC.name}`] = InputVoltageAC;
hap_nodejs_1.Characteristic[`Community: ${OutputVoltageAC.name}`] = OutputVoltageAC;
hap_nodejs_1.Characteristic[`Community: ${BatteryVoltageDC.name}`] = BatteryVoltageDC;
hap_nodejs_1.Characteristic[`Community: ${UPSLoadPercent.name}`] = UPSLoadPercent;
hap_nodejs_1.Service[`Community: ${AudioDeviceService.name}`] = AudioDeviceService;
hap_nodejs_1.Service[`Community: ${PlaybackDeviceService.name}`] = PlaybackDeviceService;
hap_nodejs_1.Service[`Community: ${MediaInformationService.name}`] = MediaInformationService;
hap_nodejs_1.Service[`Community: ${StillImageService.name}`] = StillImageService;
hap_nodejs_1.Service[`Community: ${SecurityCameraService.name}`] = SecurityCameraService;
hap_nodejs_1.Service[`Community: ${AtmosphericPressureSensor.name}`] = AtmosphericPressureSensor;
hap_nodejs_1.Service[`Community: ${NoiseLevelSensor.name}`] = NoiseLevelSensor;
hap_nodejs_1.Service[`Community: ${AirFlowSensor.name}`] = AirFlowSensor;
hap_nodejs_1.Service[`Community: ${NitrogenDioxideSensor.name}`] = NitrogenDioxideSensor;
hap_nodejs_1.Service[`Community: ${OzoneSensor.name}`] = OzoneSensor;
hap_nodejs_1.Service[`Community: ${SodiumDioxideSensor.name}`] = SodiumDioxideSensor;
hap_nodejs_1.Service[`Community: ${VolatileOrganicCompoundSensor.name}`] = VolatileOrganicCompoundSensor;
hap_nodejs_1.Service[`Community: ${NotificationService.name}`] = NotificationService;
hapTypesImported = true;
}
class Timestamp extends hap_nodejs_1.Characteristic {
constructor() {
super('Timestamp', 'FF000001-0000-1000-8000-135D67EC4377', {
format: "string" /* Formats.STRING */,
perms: ["pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */, "ev" /* Perms.NOTIFY */],
});
// this.value = this.getDefaultValue();
}
}
exports.Timestamp = Timestamp;
class AudioDataURL extends hap_nodejs_1.Characteristic {
constructor() {
super('Audio URL', 'FF000002-0000-1000-8000-135D67EC4377', {
format: "string" /* Formats.STRING */,
perms: ["pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */, "ev" /* Perms.NOTIFY */],
});
}
}
exports.AudioDataURL = AudioDataURL;
class VideoDataURL extends hap_nodejs_1.Characteristic {
constructor() {
super('Video URL', 'FF000003-0000-1000-8000-135D67EC4377', {
format: "string" /* Formats.STRING */,
perms: ["pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */, "ev" /* Perms.NOTIFY */],
});
}
}
exports.VideoDataURL = VideoDataURL;
class AudioVolume extends hap_nodejs_1.Characteristic {
constructor() {
super('Audio Volume', '00001001-0000-1000-8000-135D67EC4377', {
format: "uint8" /* Formats.UINT8 */,
unit: "percentage" /* Units.PERCENTAGE */,
maxValue: 100,
minValue: 0,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */, "ev" /* Perms.NOTIFY */],
});
// this.value = this.getDefaultValue();
}
}
exports.AudioVolume = AudioVolume;
class Muting extends hap_nodejs_1.Characteristic {
constructor() {
super('Muting', '00001002-0000-1000-8000-135D67EC4377', {
format: "uint8" /* Formats.UINT8 */,
perms: ["pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */, "ev" /* Perms.NOTIFY */],
});
// this.value = this.getDefaultValue();
}
}
exports.Muting = Muting;
class PlaybackState extends hap_nodejs_1.Characteristic {
constructor() {
super('Playback State', '00002001-0000-1000-8000-135D67EC4377', {
format: "uint8" /* Formats.UINT8 */,
perms: ["pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */, "ev" /* Perms.NOTIFY */],
});
// this.value = this.getDefaultValue();
}
}
exports.PlaybackState = PlaybackState;
PlaybackState.PLAYING = 0;
PlaybackState.PAUSED = 1;
PlaybackState.STOPPED = 2;
class SkipForward extends hap_nodejs_1.Characteristic {
constructor() {
super('Skip Forward', '00002002-0000-1000-8000-135D67EC4377', {
format: "bool" /* Formats.BOOL */,
perms: ["pw" /* Perms.PAIRED_WRITE */],
});
// this.value = this.getDefaultValue();
}
}
exports.SkipForward = SkipForward;
class SkipBackward extends hap_nodejs_1.Characteristic {
constructor() {
super('Skip Backward', '00002003-0000-1000-8000-135D67EC4377', {
format: "bool" /* Formats.BOOL */,
perms: ["pw" /* Perms.PAIRED_WRITE */],
});
// this.value = this.getDefaultValue();
}
}
exports.SkipBackward = SkipBackward;
class ShuffleMode extends hap_nodejs_1.Characteristic {
constructor() {
super('Shuffle Mode', '00002004-0000-1000-8000-135D67EC4377', {
format: "uint8" /* Formats.UINT8 */,
perms: ["pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.ShuffleMode = ShuffleMode;
//NOTE: If GROUP or SET is not supported, accessories should coerce to ALBUM.
// If ALBUM is not supported, coerce to ITEM.
// In general, it is recommended for apps to only assume OFF, ITEM, and ALBUM
// are supported unless it is known that the accessory supports other settings.
ShuffleMode.OFF = 0;
//NOTE: INDIVIDUAL is deprecated.
ShuffleMode.INDIVIDUAL = 1;
ShuffleMode.ITEM = 1;
ShuffleMode.GROUP = 2; // e.g., iTunes "Groupings"
ShuffleMode.ALBUM = 3; // e.g., album or season
ShuffleMode.SET = 4; // e.g., T.V. Series or album box set
class RepeatMode extends hap_nodejs_1.Characteristic {
constructor() {
super('Repeat Mode', '00002005-0000-1000-8000-135D67EC4377', {
format: "uint8" /* Formats.UINT8 */,
perms: ["pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */, "ev" /* Perms.NOTIFY */],
});
// this.value = this.getDefaultValue();
}
}
exports.RepeatMode = RepeatMode;
RepeatMode.OFF = 0;
RepeatMode.ONE = 1;
RepeatMode.ALL = 2;
class PlaybackSpeed extends hap_nodejs_1.Characteristic {
constructor() {
super('Playback Speed', '00002006-0000-1000-8000-135D67EC4377', {
format: "float" /* Formats.FLOAT */,
perms: ["pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */, "ev" /* Perms.NOTIFY */],
});
// this.value = this.getDefaultValue();
}
}
exports.PlaybackSpeed = PlaybackSpeed;
class MediaCurrentPosition extends hap_nodejs_1.Characteristic {
constructor() {
super('Media Current Position', '00002007-0000-1000-8000-135D67EC4377', {
format: "float" /* Formats.FLOAT */, // In seconds
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */],
});
}
}
exports.MediaCurrentPosition = MediaCurrentPosition;
class MediaItemName extends hap_nodejs_1.Characteristic {
constructor() {
super('Media Name', '00003001-0000-1000-8000-135D67EC4377', {
format: "string" /* Formats.STRING */,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */],
});
// this.value = this.getDefaultValue();
}
}
exports.MediaItemName = MediaItemName;
class MediaItemAlbumName extends hap_nodejs_1.Characteristic {
constructor() {
super('Media Album Name', '00003002-0000-1000-8000-135D67EC4377', {
format: "string" /* Formats.STRING */,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */],
});
// this.value = this.getDefaultValue();
}
}
exports.MediaItemAlbumName = MediaItemAlbumName;
class MediaItemArtist extends hap_nodejs_1.Characteristic {
constructor() {
super('Media Artist', '00003003-0000-1000-8000-135D67EC4377', {
format: "string" /* Formats.STRING */,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */],
});
// this.value = this.getDefaultValue();
}
}
exports.MediaItemArtist = MediaItemArtist;
class MediaItemDuration extends hap_nodejs_1.Characteristic {
constructor() {
super('Media Duration', '00003005-0000-1000-8000-135D67EC4377', {
format: "float" /* Formats.FLOAT */, // In seconds
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.MediaItemDuration = MediaItemDuration;
class StillImage extends hap_nodejs_1.Characteristic {
constructor() {
super('Still Image', '00004001-0000-1000-8000-135D67EC4377', {
format: "data" /* Formats.DATA */,
perms: ["pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */, "ev" /* Perms.NOTIFY */]
});
this.value = this.getDefaultValue();
}
}
exports.StillImage = StillImage;
// Also known as MIME type...
class MediaTypeIdentifier extends hap_nodejs_1.Characteristic {
constructor() {
super('Media Type Identifier', '00004002-0000-1000-8000-135D67EC4377', {
format: "string" /* Formats.STRING */,
perms: ["pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.MediaTypeIdentifier = MediaTypeIdentifier;
class MediaWidth extends hap_nodejs_1.Characteristic {
constructor() {
super('Media Width', '00004003-0000-1000-8000-135D67EC4377', {
format: "uint32" /* Formats.UINT32 */,
perms: ["pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */, "ev" /* Perms.NOTIFY */]
});
this.value = this.getDefaultValue();
}
}
exports.MediaWidth = MediaWidth;
class MediaHeight extends hap_nodejs_1.Characteristic {
constructor() {
super('Media Width', '00004004-0000-1000-8000-135D67EC4377', {
format: "uint32" /* Formats.UINT32 */,
perms: ["pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.MediaHeight = MediaHeight;
// courtesy of https://gist.github.com/gomfunkel/b1a046d729757120907c
class Volts extends hap_nodejs_1.Characteristic {
constructor() {
super('Volts', 'E863F10A-079E-48FF-8F27-9C2605A29F52', {
format: "uint16" /* Formats.UINT16 */,
unit: 'V',
minValue: 0,
maxValue: 65535,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
this.value = this.getDefaultValue();
}
}
exports.Volts = Volts;
class Amperes extends hap_nodejs_1.Characteristic {
constructor() {
super('Amps', 'E863F126-079E-48FF-8F27-9C2605A29F52', {
format: "uint16" /* Formats.UINT16 */,
unit: "A",
minValue: 0,
maxValue: 65535,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
this.value = this.getDefaultValue();
}
}
exports.Amperes = Amperes;
class Watts extends hap_nodejs_1.Characteristic {
constructor() {
super('Consumption', 'E863F10D-079E-48FF-8F27-9C2605A29F52', {
format: "uint16" /* Formats.UINT16 */,
unit: 'W',
minValue: 0,
maxValue: 65535,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.Watts = Watts;
class VoltAmperes extends hap_nodejs_1.Characteristic {
constructor() {
super('Apparent Power', 'E863F110-079E-48FF-8F27-9C2605A29F52', {
format: "uint16" /* Formats.UINT16 */,
unit: 'VA',
minValue: 0,
maxValue: 65535,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
this.value = this.getDefaultValue();
}
}
exports.VoltAmperes = VoltAmperes;
class KilowattHours extends hap_nodejs_1.Characteristic {
constructor() {
super('Total Consumption', 'E863F10C-079E-48FF-8F27-9C2605A29F52', {
format: "uint32" /* Formats.UINT32 */,
unit: "kWh",
minValue: 0,
maxValue: 65535,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.KilowattHours = KilowattHours;
class KilowattVoltAmpereHour extends hap_nodejs_1.Characteristic {
constructor() {
super('Apparent Energy', 'E863F127-079E-48FF-8F27-9C2605A29F52', {
format: "uint32" /* Formats.UINT32 */,
unit: "kVAh",
minValue: 0,
maxValue: 65535,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.KilowattVoltAmpereHour = KilowattVoltAmpereHour;
class BatteryLevel extends hap_nodejs_1.Characteristic {
constructor() {
super('Battery Level', 'E863F11B-079E-48FF-8F27-9C2605A29F52', {
format: "uint16" /* Formats.UINT16 */,
unit: "percentage" /* Units.PERCENTAGE */,
maxValue: 100,
minValue: 0,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */]
});
}
}
exports.BatteryLevel = BatteryLevel;
class EveAirQuality extends hap_nodejs_1.Characteristic {
constructor() {
super('Eve Air Quality', 'E863F10B-079E-48FF-8F27-9C2605A29F52', {
format: "uint16" /* Formats.UINT16 */,
unit: "ppm",
maxValue: 5000,
minValue: 0,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */],
});
// this.value = this.getDefaultValue();
}
}
exports.EveAirQuality = EveAirQuality;
// courtesy of https://github.com/ebaauw/homebridge-lib
// i should probably submit a PR for everything here that isn't in that repo...
class EveOpenDuration extends hap_nodejs_1.Characteristic {
constructor() {
super('Eve Open Duration', 'E863F118-079E-48FF-8F27-9C2605A29F52', {
format: "uint32" /* Formats.UINT32 */,
unit: "seconds" /* Units.SECONDS */, // since last reset
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */, "pw" /* Perms.PAIRED_WRITE */]
});
// this.value = this.getDefaultValue();
}
}
exports.EveOpenDuration = EveOpenDuration;
class EveClosedDuration extends hap_nodejs_1.Characteristic {
constructor() {
super('Eve Closed Duration', 'E863F119-079E-48FF-8F27-9C2605A29F52', {
format: "uint32" /* Formats.UINT32 */,
unit: "seconds" /* Units.SECONDS */, // since last reset
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */, "pw" /* Perms.PAIRED_WRITE */]
});
}
}
exports.EveClosedDuration = EveClosedDuration;
class EveLastAction extends hap_nodejs_1.Characteristic {
constructor() {
super('Eve Last Activation', 'E863F11A-079E-48FF-8F27-9C2605A29F52', {
format: "uint32" /* Formats.UINT32 */,
unit: "seconds" /* Units.SECONDS */, // since last reset
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.EveLastAction = EveLastAction;
class EveTimesOpened extends hap_nodejs_1.Characteristic {
constructor() {
super('Eve Times Opened', 'E863F129-079E-48FF-8F27-9C2605A29F52', {
format: "uint32" /* Formats.UINT32 */,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
}
}
exports.EveTimesOpened = EveTimesOpened;
class EveResetTotal extends hap_nodejs_1.Characteristic {
constructor() {
super('Eve Reset Total', 'E863F112-079E-48FF-8F27-9C2605A29F52', {
format: "uint32" /* Formats.UINT32 */,
unit: "seconds" /* Units.SECONDS */, // since 2001/01/01
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */, "pw" /* Perms.PAIRED_WRITE */]
});
// this.value = this.getDefaultValue();
}
}
exports.EveResetTotal = EveResetTotal;
// courtesy of https://github.com/robi-van-kinobi/homebridge-cubesensors
class AtmosphericPressureLevel extends hap_nodejs_1.Characteristic {
constructor() {
super('Barometric Pressure', '28FDA6BC-9C2A-4DEA-AAFD-B49DB6D155AB', {
format: "uint8" /* Formats.UINT8 */,
unit: "mbar",
minValue: 800,
maxValue: 1200,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
}
}
exports.AtmosphericPressureLevel = AtmosphericPressureLevel;
class NoiseLevel extends hap_nodejs_1.Characteristic {
constructor() {
super('Noise Level', '2CD7B6FD-419A-4740-8995-E3BFE43735AB', {
format: "uint8" /* Formats.UINT8 */,
unit: "dB",
minValue: 0,
maxValue: 200,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.NoiseLevel = NoiseLevel;
// courtesy of https://github.com/homespun/homebridge-platform-snmp
class AirFlow extends hap_nodejs_1.Characteristic {
constructor() {
super('Air Flow', '49C8AE5A-A3A5-41AB-BF1F-12D5654F9F41', {
format: "uint8" /* Formats.UINT8 */,
unit: "m/s",
minValue: 0,
maxValue: 135,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.AirFlow = AirFlow;
class NitrogenDioxideDetected extends hap_nodejs_1.Characteristic {
constructor() {
super('Nitrogen Dioxide Detected', 'D737B40A-3AF0-4316-950F-76090B98C5CF', {
format: "uint8" /* Formats.UINT8 */,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.NitrogenDioxideDetected = NitrogenDioxideDetected;
NitrogenDioxideDetected.NO2_LEVELS_NORMAL = 0;
NitrogenDioxideDetected.NO2_LEVELS_ABNORMAL = 1;
class NitrogenDioxideLevel extends hap_nodejs_1.Characteristic {
constructor() {
super('Nitrogen Dioxide Level', 'B762A2AF-D9D0-4A79-814A-E9EBAB0ED290', {
format: "float" /* Formats.FLOAT */,
unit: "ppm",
minValue: 0,
maxValue: 1500,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.NitrogenDioxideLevel = NitrogenDioxideLevel;
class NitrogenDioxidePeakLevel extends hap_nodejs_1.Characteristic {
constructor() {
super('Nitrogen Dioxide Peak Level', 'B6594847-7B88-496C-A1A0-B7860F3D7601', {
format: "float" /* Formats.FLOAT */,
unit: "ppm",
minValue: 0,
maxValue: 1500,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.NitrogenDioxidePeakLevel = NitrogenDioxidePeakLevel;
// courtesy of https://github.com/homespun/homebridge-platform-aqe
class OzoneDetected extends hap_nodejs_1.Characteristic {
constructor() {
super('Ozone Detected', '0168FA60-5CF4-4314-AA45-0F84E389A093', {
format: "uint8" /* Formats.UINT8 */,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
this.value = this.getDefaultValue();
}
}
exports.OzoneDetected = OzoneDetected;
OzoneDetected.O3_LEVELS_NORMAL = 0;
OzoneDetected.O3_LEVELS_ABNORMAL = 1;
class OzoneLevel extends hap_nodejs_1.Characteristic {
constructor() {
super('Ozone Level', '03C17FD9-672E-42F5-8DD4-30C6822C739A', {
format: "float" /* Formats.FLOAT */,
unit: "ppb",
minValue: 0,
maxValue: 1500,
minStep: 0.01,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.OzoneLevel = OzoneLevel;
class OzonePeakLevel extends hap_nodejs_1.Characteristic {
constructor() {
super('Ozone Peak Level', '550EE1FF-FC66-4BB6-A1C1-4B0A07109AE3', {
format: "float" /* Formats.FLOAT */,
unit: "ppb",
minValue: 0,
maxValue: 1500,
minStep: 0.01,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.OzonePeakLevel = OzonePeakLevel;
class SodiumDioxideDetected extends hap_nodejs_1.Characteristic {
constructor() {
super('Sodium Dioxide Detected', '4D237DAB-1CB6-4D52-B446-4667F58F7D28', {
format: "uint8" /* Formats.UINT8 */,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.SodiumDioxideDetected = SodiumDioxideDetected;
SodiumDioxideDetected.SO2_LEVELS_NORMAL = 0;
SodiumDioxideDetected.SO2_LEVELS_ABNORMAL = 1;
class SodiumDioxideLevel extends hap_nodejs_1.Characteristic {
constructor() {
super('Sodium Dioxide Level', '66C4D315-FBEF-470E-9434-B047679F1141', {
format: "float" /* Formats.FLOAT */,
unit: "ppb",
minValue: 0,
maxValue: 1500,
minStep: 0.01,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.SodiumDioxideLevel = SodiumDioxideLevel;
class SodiumDioxidePeakLevel extends hap_nodejs_1.Characteristic {
constructor() {
super('Sodium Dioxide Peak Level', '4CD6F648-2F92-43D8-86DF-0E8DE75E033B', {
format: "float" /* Formats.FLOAT */,
unit: "ppb",
minValue: 0,
maxValue: 1500,
minStep: 0.01,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.SodiumDioxidePeakLevel = SodiumDioxidePeakLevel;
class VolatileOrganicCompoundDetected extends hap_nodejs_1.Characteristic {
constructor() {
super('Volatile Organic Compound Detected', '65DBC0F5-C40B-4E04-ADED-DC70031B0B82', {
format: "uint8" /* Formats.UINT8 */,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.VolatileOrganicCompoundDetected = VolatileOrganicCompoundDetected;
VolatileOrganicCompoundDetected.VOC_LEVELS_NORMAL = 0;
VolatileOrganicCompoundDetected.VOC_LEVELS_ABNORMAL = 1;
class VolatileOrganicCompoundLevel extends hap_nodejs_1.Characteristic {
constructor() {
super('Volatile Organic Compound Level', '35C4C797-193D-4998-879F-A08514E87897', {
format: "float" /* Formats.FLOAT */,
unit: "ppb",
minValue: 0,
maxValue: 1500,
minStep: 0.01,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.VolatileOrganicCompoundLevel = VolatileOrganicCompoundLevel;
class VolatileOrganicCompoundPeakLevel extends hap_nodejs_1.Characteristic {
constructor() {
super('Volatile Organic Compound Peak Level', 'A62CB784-1916-4BDF-B840-BDB9F8A264E9', {
format: "float" /* Formats.FLOAT */,
unit: "ppb",
minValue: 0,
maxValue: 1500,
minStep: 0.01,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.VolatileOrganicCompoundPeakLevel = VolatileOrganicCompoundPeakLevel;
class NotificationCode extends hap_nodejs_1.Characteristic {
constructor() {
super('Notification Code', '381C47A3-CB06-4177-8E3D-A1B4C22EB031', {
format: "uint8" /* Formats.UINT8 */,
maxValue: 255,
minValue: 0,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "pw" /* Perms.PAIRED_WRITE */, "ev" /* Perms.NOTIFY */]
});
this.value = 255;
}
}
exports.NotificationCode = NotificationCode;
class NotificationText extends hap_nodejs_1.Characteristic {
constructor() {
super('Notification Text', 'e244ca80-813e-423a-86bd-02f293b857a0', {
format: "string" /* Formats.STRING */,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.NotificationText = NotificationText;
// used by Elgato Eve, number of seconds since the epoch...
class LastEventTime extends hap_nodejs_1.Characteristic {
constructor() {
super('Last Event Time', 'E863F11A-079E-48FF-8F27-9C2605A29F52', {
format: "uint32" /* Formats.UINT32 */,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.LastEventTime = LastEventTime;
// courtesy of https://github.com/SeydX/homebridge-broadband
class DownloadSpeed extends hap_nodejs_1.Characteristic {
constructor() {
super('Download Speed', 'DA70DA1F-DA72-4DB3-81C2-99F158A15A9A', {
format: "float" /* Formats.FLOAT */,
unit: 'Mbps',
maxValue: 1024,
minValue: 0,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.DownloadSpeed = DownloadSpeed;
class UploadSpeed extends hap_nodejs_1.Characteristic {
constructor() {
super('Upload Speed', 'AB74289E-D516-4A12-B2AE-1B32A74C035F', {
format: "float" /* Formats.FLOAT */,
unit: 'Mbps',
maxValue: 1024,
minValue: 0,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.UploadSpeed = UploadSpeed;
class Ping extends hap_nodejs_1.Characteristic {
constructor() {
super('Ping', 'CC65A09A-E052-410C-981D-C11BDE2C3F60', {
format: "int" /* Formats.INT */,
unit: 'ms',
maxValue: 999,
minValue: 0,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.Ping = Ping;
class Latency extends hap_nodejs_1.Characteristic {
constructor() {
super('Latency', '60EC80F9-F799-4E8E-B613-098E7EBCBB0B', {
format: "int" /* Formats.INT */,
unit: 'ms',
maxValue: 999,
minValue: 0,
minStep: 0.001,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.Latency = Latency;
// https://github.com/naofireblade/homebridge-weather-plus
class DewPoint extends hap_nodejs_1.Characteristic {
constructor() {
super('Dew Point', '095c46e2-278e-4e3c-b9e7-364622a0f501', {
format: "float" /* Formats.FLOAT */,
unit: "celsius" /* Units.CELSIUS */,
maxValue: 50,
minValue: -50,
minStep: 0.1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.DewPoint = DewPoint;
// courtesy of https://github.com/ToddGreenfield/homebridge-nut
class InputVoltageAC extends hap_nodejs_1.Characteristic {
constructor() {
super('Input Voltage AC', hap_nodejs_1.uuid.generate('CommunityTypes:usagedevice:InputVoltageAC'),
// UUID.generate('CommunityTypes:usagedevice:InputVoltageAC'),
{
format: "float" /* Formats.FLOAT */,
unit: "V",
minValue: 0,
maxValue: 65535,
minStep: 0.01,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
}
}
exports.InputVoltageAC = InputVoltageAC;
class OutputVoltageAC extends hap_nodejs_1.Characteristic {
constructor() {
super('Output Voltage AC', hap_nodejs_1.uuid.generate('CommunityTypes:usagedevice:OutputVoltageAC'), {
format: "float" /* Formats.FLOAT */,
unit: "V",
minValue: 0,
maxValue: 65535,
minStep: 0.01,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.OutputVoltageAC = OutputVoltageAC;
class BatteryVoltageDC extends hap_nodejs_1.Characteristic {
constructor() {
super('Battery Voltage DC', hap_nodejs_1.uuid.generate('CommunityTypes:usagedevice:BatteryVoltageDC'), {
format: "float" /* Formats.FLOAT */,
unit: "V",
minValue: 0,
maxValue: 65535,
minStep: 0.01,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.BatteryVoltageDC = BatteryVoltageDC;
class UPSLoadPercent extends hap_nodejs_1.Characteristic {
constructor() {
super('UPS Load', hap_nodejs_1.uuid.generate('CommunityTypes:usagedevice:UPSLoadPercent'), {
format: "uint8" /* Formats.UINT8 */,
unit: "percentage" /* Units.PERCENTAGE */,
minValue: 0,
maxValue: 100,
minStep: 1,
perms: ["pr" /* Perms.PAIRED_READ */, "ev" /* Perms.NOTIFY */]
});
// this.value = this.getDefaultValue();
}
}
exports.UPSLoadPercent = UPSLoadPercent;
// Services
class AudioDeviceService extends hap_nodejs_1.Service {
constructor(displayName, subtype) {
super(displayName, '00000001-0000-1000-8000-135D67EC4377', subtype);
// Required Characteristics
this.addCharacteristic(AudioVolume);
// Optional Characteristics
this.addOptionalCharacteristic(Muting);
this.addOptionalCharacteristic(hap_nodejs_1.Characteristic.Name);
}
}
exports.AudioDeviceService = AudioDeviceService;
class PlaybackDeviceService extends hap_nodejs_1.Service {
constructor(displayName, subtype) {
super(displayName, '00000002-0000-1000-8000-135D67EC4377', subtype);
// Required Characteristics
this.addCharacteristic(PlaybackState);
// Optional Characteristics
this.addOptionalCharacteristic(SkipForward);
this.addOptionalCharacteristic(SkipBackward);
this.addOptionalCharacteristic(ShuffleMode);
this.addOptionalCharacteristic(RepeatMode);
this.addOptionalCharacteristic(PlaybackSpeed);
this.addOptionalCharacteristic(MediaCurrentPosition);
this.addOptionalCharacteristic(MediaItemName);
this.addOptionalCharacteristic(MediaItemAlbumName);
this.addOptionalCharacteristic(MediaItemArtist);
this.addOptionalCharacteristic(MediaItemDuration);
this.addOptionalCharacteristic(hap_nodejs_1.Characteristic.Name);
// Artwork characteristics...would be better reported in a separate service?
this.addOptionalCharacteristic(StillImage);
this.addOptionalCharacteristic(MediaTypeIdentifier);
this.addOptionalCharacteristic(MediaWidth);
this.addOptionalCharacteristic(MediaHeight);
}
}
exports.PlaybackDeviceService = PlaybackDeviceService;
// A media information service that has no playback controls, for e.g. DAB radio...