-
Notifications
You must be signed in to change notification settings - Fork 60
/
characteristics.h
2712 lines (2422 loc) · 95 KB
/
characteristics.h
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
#ifndef __HOMEKIT_CHARACTERISTICS__
#define __HOMEKIT_CHARACTERISTICS__
#include "types.h"
#include "port_x.h"
// MARK: - Apple UUID
#ifdef HOMEKIT_SHORT_APPLE_UUIDS
#define HOMEKIT_APPLE_UUID8(value) (value)
#define HOMEKIT_APPLE_UUID7(value) (value)
#define HOMEKIT_APPLE_UUID6(value) (value)
#define HOMEKIT_APPLE_UUID5(value) (value)
#define HOMEKIT_APPLE_UUID4(value) (value)
#define HOMEKIT_APPLE_UUID3(value) (value)
#define HOMEKIT_APPLE_UUID2(value) (value)
#define HOMEKIT_APPLE_UUID1(value) (value)
#define HOMEKIT_APPLE_UUID0(value) (value)
#else
#define HOMEKIT_APPLE_UUID8(value) (value "-0000-1000-8000-0026BB765291")
#define HOMEKIT_APPLE_UUID7(value) HOMEKIT_APPLE_UUID8("0" value)
#define HOMEKIT_APPLE_UUID6(value) HOMEKIT_APPLE_UUID7("0" value)
#define HOMEKIT_APPLE_UUID5(value) HOMEKIT_APPLE_UUID6("0" value)
#define HOMEKIT_APPLE_UUID4(value) HOMEKIT_APPLE_UUID5("0" value)
#define HOMEKIT_APPLE_UUID3(value) HOMEKIT_APPLE_UUID4("0" value)
#define HOMEKIT_APPLE_UUID2(value) HOMEKIT_APPLE_UUID3("0" value)
#define HOMEKIT_APPLE_UUID1(value) HOMEKIT_APPLE_UUID2("0" value)
#define HOMEKIT_APPLE_UUID0(value) HOMEKIT_APPLE_UUID1("0" value)
#endif
// MARK: - Services
/**
Defines information about a certain accessory, including a action to identify the accessory.
Required Characteristics:
- IDENTIFY
- MANUFACTURER
- MODEL
- NAME
- SERIAL_NUMBER
- FIRMWARE_REVISION
Optional Characteristics:
- HARDWARE_REVISION
- ACCESSORY_FLAGS
*/
#define HOMEKIT_SERVICE_ACCESSORY_INFORMATION HOMEKIT_APPLE_UUID2("3E")
/**
Defines that the accessory constains a fan. For more features see FAN2.
Required Characteristics:
- ON
Optional Characteristics:
- NAME
- ROTATION_DIRECTION
- ROTATION_SPEED
*/
#define HOMEKIT_SERVICE_FAN HOMEKIT_APPLE_UUID2("40")
/**
Defines that the accessory has control over the opening of a garage door.
Required Characteristics:
- CURRENT_DOOR_STATE
- TARGET_DOOR_STATE
- OBSTRUCTION_DETECTED
Optional Characteristics:
- NAME
- LOCK_CURRENT_STATE
- LOCK_TARGET_STATE
*/
#define HOMEKIT_SERVICE_GARAGE_DOOR_OPENER HOMEKIT_APPLE_UUID2("41")
/**
Defines that the accessory contains a lightbulb.
Required Characteristics:
- ON
Optional Characteristics:
- NAME
- BRIGHTNESS
- HUE
- SATURATION
- COLOR_TEMPERATURE
*/
#define HOMEKIT_SERVICE_LIGHTBULB HOMEKIT_APPLE_UUID2("43")
/**
Defines a number of additional settings, rules and information on a lock mechanism inside of a accessory.
Required Characteristics:
- LOCK_CONTROL_POINT
- VERSION
Optional Characteristics:
- NAME
- LOGS
- AUDIO_FEEDBACK
- LOCK_MANAGEMENT_AUTO_SECURITY_TIMEOUT
- ADMINISTRATOR_ONLY_ACCESS
- LOCK_LAST_KNOWN_ACTION
- CURRENT_DOOR_STATE
- MOTION_DETECTED
*/
#define HOMEKIT_SERVICE_LOCK_MANAGEMENT HOMEKIT_APPLE_UUID2("44")
/**
Defines that the accessory constains a lock mechanism. This can be combined with Lock Management.
Required Characteristics:
- LOCK_CURRENT_STATE
- LOCK_TARGET_STATE
Optional Characteristics:
- NAME
*/
#define HOMEKIT_SERVICE_LOCK_MECHANISM HOMEKIT_APPLE_UUID2("45")
/**
Defines that the accessory contains an outlet/socket.
Required Characteristics:
- ON
- OUTLET_IN_USE
Optional Characteristics:
- NAME
*/
#define HOMEKIT_SERVICE_OUTLET HOMEKIT_APPLE_UUID2("47")
/**
Defines that the accessory contains a switch.
Required Characteristics:
- ON
Optional Characteristics:
- NAME
*/
#define HOMEKIT_SERVICE_SWITCH HOMEKIT_APPLE_UUID2("49")
/**
Defines that the accessory contains a thermostat.
Required Characteristics:
- CURRENT_HEATING_COOLING_STATE
- TARGET_HEATING_COOLING_STATE
- CURRENT_TEMPERATURE
- TARGET_TEMPERATURE
- TEMPERATURE_DISPLAY_UNITS
Optional Characteristics:
- NAME
- CURRENT_RELATIVE_HUMIDITY
- TARGET_RELATIVE_HUMIDITY
- COOLING_THRESHOLD_TEMPERATURE
- HEATING_THRESHOLD_TEMPERATURE
*/
#define HOMEKIT_SERVICE_THERMOSTAT HOMEKIT_APPLE_UUID2("4A")
/**
Defines that the accessory contains a air quality sensor.
Required Characteristics:
- AIR_QUALITY
Optional Characteristics:
- NAME
- STATUS_ACTIVE
- STATUS_FAULT
- STATUS_TAMPERED
- STATUS_LOW_BATTERY
- OZONE_DENSITY
- NITROGEN_DIOXIDE_DENSITY
- SULPHUR_DIOXIDE_DENSITY
- PM25_DENSITY
- PM10_DENSITY
- VOC_DENSITY
- CARBON_MONOXIDE_LEVEL
- CARBON_DIOXIDE_LEVEL
*/
#define HOMEKIT_SERVICE_AIR_QUALITY_SENSOR HOMEKIT_APPLE_UUID2("8D")
/**
Defines that the accessory contains a security system.
Required Characteristics:
- SECURITY_SYSTEM_CURRENT_STATE
- SECURITY_SYSTEM_TARGET_STATE
Optional Characteristics:
- NAME
- STATUS_FAULT
- STATUS_TAMPERED
- SECURITY_SYSTEM_ALARM_TYPE
*/
#define HOMEKIT_SERVICE_SECURITY_SYSTEM HOMEKIT_APPLE_UUID2("7E")
/**
Defines that the accessory contains a monoxide dioxide (CO) sensor.
Required Characteristics:
- CARBON_MONOXIDE_DETECTED
Optional Characteristics:
- NAME
- STATUS_ACTIVE
- STATUS_FAULT
- STATUS_LOW_BATTERY
- STATUS_TAMPERED
- CARBON_MONOXIDE_LEVEL
- CARBON_MONOXIDE_PEAK_LEVEL
*/
#define HOMEKIT_SERVICE_CARBON_MONOXIDE_SENSOR HOMEKIT_APPLE_UUID2("7F")
/**
Defines that the accessory contains a contact sensor.
Required Characteristics:
- CONTACT_SENSOR_STATE
Optional Characteristics:
- NAME
- STATUS_ACTIVE
- STATUS_FAULT
- STATUS_TAMPERED
- STATUS_LOW_BATTERY
*/
#define HOMEKIT_SERVICE_CONTACT_SENSOR HOMEKIT_APPLE_UUID2("80")
/**
Defines that the accessory contains or controls a door.
Required Characteristics:
- CURRENT_POSITION
- TARGET_POSITION
- POSITION_STATE
Optional Characteristics:
- NAME
- HOLD_POSITION
- OBSTRUCTION_DETECTED
*/
#define HOMEKIT_SERVICE_DOOR HOMEKIT_APPLE_UUID2("81")
/**
Defines that the accessory contains a (relative) humidity sensor.
Required Characteristics:
- CURRENT_RELATIVE_HUMIDITY
Optional Characteristics:
- NAME
- STATUS_ACTIVE
- STATUS_FAULT
- STATUS_TAMPERED
- STATUS_LOW_BATTERY
*/
#define HOMEKIT_SERVICE_HUMIDITY_SENSOR HOMEKIT_APPLE_UUID2("82")
/**
Defines that the accessory contains a (water) leak sensor.
Required Characteristics:
- LEAK_DETECTED
Optional Characteristics:
- NAME
- STATUS_ACTIVE
- STATUS_FAULT
- STATUS_LOW_BATTERY
- STATUS_TAMPERED
*/
#define HOMEKIT_SERVICE_LEAK_SENSOR HOMEKIT_APPLE_UUID2("83")
/**
Defines that the accessory contains a light sensor.
Required Characteristics:
- CURRENT_AMBIENT_LIGHT_LEVEL
Optional Characteristics:
- NAME
- STATUS_ACTIVE
- STATUS_FAULT
- STATUS_LOW_BATTERY
- STATUS_TAMPERED
*/
#define HOMEKIT_SERVICE_LIGHT_SENSOR HOMEKIT_APPLE_UUID2("84")
/**
Defines that the accessory contains a motion sensor.
Required Characteristics:
- MOTION_DETECTED
Optional Characteristics:
- NAME
- STATUS_ACTIVE
- STATUS_FAULT
- STATUS_LOW_BATTERY
- STATUS_TAMPERED
*/
#define HOMEKIT_SERVICE_MOTION_SENSOR HOMEKIT_APPLE_UUID2("85")
/**
Defines that the accessory contains a occupancy sensor.
Required Characteristics:
- OCCUPANCY_DETECTED
Optional Characteristics:
- NAME
- STATUS_ACTIVE
- STATUS_FAULT
- STATUS_LOW_BATTERY
- STATUS_TAMPERED
*/
#define HOMEKIT_SERVICE_OCCUPANCY_SENSOR HOMEKIT_APPLE_UUID2("86")
/**
Defines that the accessory contains a smoke sensor.
Required Characteristics:
- SMOKE_DETECTED
Optional Characteristics:
- NAME
- STATUS_ACTIVE
- STATUS_FAULT
- STATUS_LOW_BATTERY
- STATUS_TAMPERED
*/
#define HOMEKIT_SERVICE_SMOKE_SENSOR HOMEKIT_APPLE_UUID2("87")
/**
Defines that the accessory contains a stateless programmable switch, also called a button.
Required Characteristics:
- PROGRAMMABLE_SWITCH_EVENT
Optional Characteristics:
- NAME
- SERVICE_LABEL_INDEX
*/
#define HOMEKIT_SERVICE_STATELESS_PROGRAMMABLE_SWITCH HOMEKIT_APPLE_UUID2("89")
/**
Defines that the accessory contains a temperature sensor.
Required Characteristics:
- CURRENT_TEMPERATURE
Optional Characteristics:
- NAME
- STATUS_ACTIVE
- STATUS_FAULT
- STATUS_TAMPERED
- STATUS_LOW_BATTERY
*/
#define HOMEKIT_SERVICE_TEMPERATURE_SENSOR HOMEKIT_APPLE_UUID2("8A")
/**
Defines that the accessory contains or controls a window.
Required Characteristics:
- CURRENT_POSITION
- TARGET_POSITION
- POSITION_STATE
Optional Characteristics:
- NAME
- HOLD_POSITION
- OBSTRUCTION_DETECTED
*/
#define HOMEKIT_SERVICE_WINDOW HOMEKIT_APPLE_UUID2("8B")
/**
Defines that the accessory constains a window covering such as a blind or curtain.
Required Characteristics:
- CURRENT_POSITION
- TARGET_POSITION
- POSITION_STATE
Optional Characteristics:
- NAME
- HOLD_POSITION
- TARGET_HORIZONTAL_TILT_ANGLE
- TARGET_VERTICAL_TILT_ANGLE
- CURRENT_HORIZONTAL_TILT_ANGLE
- CURRENT_VERTICAL_TILT_ANGLE
- OBSTRUCTION_DETECTED
*/
#define HOMEKIT_SERVICE_WINDOW_COVERING HOMEKIT_APPLE_UUID2("8C")
/**
Defines that the accessory contains a battery that can be monitored.
Required Characteristics:
- BATTERY_LEVEL
- CHARGING_STATE
- STATUS_LOW_BATTERY
Optional Characteristics:
- NAME
*/
#define HOMEKIT_SERVICE_BATTERY_SERVICE HOMEKIT_APPLE_UUID2("96")
/**
Defines that the accessory contains a carbon dioxide (CO2) sensor.
Required Characteristics:
- CARBON_DIOXIDE_DETECTED
Optional Characteristics:
- NAME
- STATUS_ACTIVE
- STATUS_FAULT
- STATUS_LOW_BATTERY
- STATUS_TAMPERED
- CARBON_DIOXIDE_LEVEL
- CARBON_DIOXIDE_PEAK_LEVEL
*/
#define HOMEKIT_SERVICE_CARBON_DIOXIDE_SENSOR HOMEKIT_APPLE_UUID2("97")
/**
Defines that the accessory allows for the management of a RTP (video) stream. This is mostly used for video doorbells and cameras and may not work standalone.
Required Characteristics:
- SUPPORTED_VIDEO_STREAM_CONFIGURATION
- SUPPORTED_AUDIO_STREAM_CONFIGURATION
- SUPPORTED_RTP_CONFIGURATION
- SELECTED_RTPS_CONFIGURATION
- STREAMING_STATUS
- SETUP_ENDPOINTS
Optional Characteristics:
- NAME
- VOLUME
*/
#define HOMEKIT_SERVICE_CAMERA_RTP_STREAM_MANAGEMENT HOMEKIT_APPLE_UUID3("110")
/**
Defines that the accessory contains a microphone. This is mostly used for video doorbells and cameras and may not work standalone.
Required Characteristics:
- MUTE
Optional Characteristics:
- NAME
- VOLUME
*/
#define HOMEKIT_SERVICE_MICROPHONE HOMEKIT_APPLE_UUID3("112")
/**
Defines that the accessory contains a speaker. This is mostly used for video doorbells and cameras and may not work standalone.
Required Characteristics:
- MUTE
Optional Characteristics:
- NAME
- VOLUME
*/
#define HOMEKIT_SERVICE_SPEAKER HOMEKIT_APPLE_UUID3("113")
/**
Defines that the accessory contains a doorbell. This is mostly used for video doorbells and may not work standalone.
Required Characteristics:
- PROGRAMMABLE_SWITCH_EVENT
Optional Characteristics:
- NAME
- BRIGHTNESS
- VOLUME
*/
#define HOMEKIT_SERVICE_DOORBELL HOMEKIT_APPLE_UUID3("121")
/**
Defines that the accessory contains a fan that implements version 2 of the fan features.
Required Characteristics:
- ACTIVE
Optional Characteristics:
- NAME
- CURRENT_FAN_STATE
- TARGET_FAN_STATE
- LOCK_PHYSICAL_CONTROLS
- ROTATION_DIRECTION
- ROTATION_SPEED
- SWING_MODE
*/
#define HOMEKIT_SERVICE_FAN2 HOMEKIT_APPLE_UUID2("B7")
/**
Defines that the accessory contains slats that tilt horizontally or vertically.
Required Characteristics:
- SLAT_TYPE
- CURRENT_SLAT_STATE
Optional Characteristics:
- NAME
- CURRENT_TILT_ANGLE
- TARGET_TILT_ANGLE
- SWING_MODE
*/
#define HOMEKIT_SERVICE_SLAT HOMEKIT_APPLE_UUID2("B9")
/**
Defines that the accessory contains a filter that can notify the user of needing maintenace.
Required Characteristics:
- FILTER_CHANGE_INDICATION
Optional Characteristics:
- NAME
- FILTER_LIFE_LEVEL
- RESET_FILTER_INDICATION
*/
#define HOMEKIT_SERVICE_FILTER_MAINTENANCE HOMEKIT_APPLE_UUID2("BA")
/**
Defines that the accessory contains a air purifier.
Required Characteristics:
- ACTIVE
- CURRENT_AIR_PURIFIER_STATE
- TARGET_AIR_PURIFIER_STATE
Optional Characteristics:
- NAME
- SWING_MODE
- LOCK_PHYSICAL_CONTROLS
- ROTATION_SPEED
*/
#define HOMEKIT_SERVICE_AIR_PURIFIER HOMEKIT_APPLE_UUID2("BB")
/**
Describes the service label scheme of the accessory. See the official HAP specification for more information.
Required Characteristics:
- ACTIVE
- SERVICE_LABEL_NAMESPACE
Optional Characteristics:
- NAME
*/
#define HOMEKIT_SERVICE_SERVICE_LABEL HOMEKIT_APPLE_UUID2("CC")
/**
Defines that the accessory contains a faucet.
Required Characteristics:
- ACTIVE
Optional Characteristics:
- NAME
- STATUS_FAULT
*/
#define HOMEKIT_SERVICE_FAUCET HOMEKIT_APPLE_UUID2("D7")
/**
Defines that the accessory supports the control of a irrigation system.
Required Characteristics:
- ACTIVE
- PROGRAM_MODE
- IN_USE
Optional Characteristics:
- NAME
- REMAINING_DURATION
- STATUS_FAULT
*/
#define HOMEKIT_SERVICE_IRRIGATION_SYSTEM HOMEKIT_APPLE_UUID2("CF")
/**
Defines that the accessory contains a (water) valve.
Required Characteristics:
- ACTIVE
- IN_USE
- VALVE_TYPE
Optional Characteristics:
- NAME
- SET_DURATION
- REMAINING_DURATION
- IS_CONFIGURED
- SERVICE_LABEL_INDEX
- STATUS_FAULT
*/
#define HOMEKIT_SERVICE_VALVE HOMEKIT_APPLE_UUID2("D0")
/**
Defines that the accessory contains a heater and/or cooler.
Accessory Category:
- 20: Heaters
- 21: Air Conditioners
Required Characteristics:
- ACTIVE
- CURRENT_TEMPERATURE
- CURRENT_HEATER_COOLER_STATE
- TARGET_HEATER_COOLER_STATE
Optional Characteristics:
- NAME
- ROTATION_SPEED
- TEMPERATURE_DISPLAY_UNITS
- SWING_MODE
- COOLING_THRESHOLD_TEMPERATURE
- HEATING_THRESHOLD_TEMPERATURE
- LOCK_PHYSICAL_CONTROLS
*/
#define HOMEKIT_SERVICE_HEATER_COOLER HOMEKIT_APPLE_UUID2("BC")
/**
Defines that the accessory contains a humidifier and/or dehumidifier.
Accessory Category:
- 22: Humidifiers
- 23: Dehumidifiers
Required Characteristics:
- ACTIVE
- CURRENT_RELATIVE_HUMIDITY
- CURRENT_HUMIDIFIER_DEHUMIDIFIER_STATE
- TARGET_HUMIDIFIER_DEHUMIDIFIER_STATE
Optional Characteristics:
- NAME
- RELATIVE_HUMIDITY_DEHUMIDIFIER_THRESHOLD
- RELATIVE_HUMIDITY_HUMIDIFIER_THRESHOLD
- ROTATION_SPEED
- SWING_MODE
- WATER_LEVEL
- LOCK_PHYSICAL_CONTROLS
*/
#define HOMEKIT_SERVICE_HUMIDIFIER_DEHUMIDIFIER HOMEKIT_APPLE_UUID2("BD")
/**
Defines that the accessory has control over television
Required Characteristics:
- ACTIVE
- ACTIVE_IDENTIFIER
- CONFIGURED_NAME
- SLEEP_DISCOVERY_MODE
Optional Characteristics:
- BRIGHTNESS
- CLOSED_CAPTIONS
- DISPLAY_ORDER
- CURRENT_MEDIA_STATE
- TARGET_MEDIA_STATE
- PICTURE_MODE
- POWER_MODE_SELECTION
- REMOTE_KEY
*/
#define HOMEKIT_SERVICE_TELEVISION HOMEKIT_APPLE_UUID2("D8")
/**
Defines that the accessory has control over television input source
Required Characteristics:
- NAME
- CONFIGURED_NAME
- INPUT_SOURCE_TYPE
- IS_CONFIGURED
- CURRENT_VISIBILITY_STATE
Optional Characteristics:
- IDENTIFIER
- INPUT_DEVICE_TYPE
- TARGET_VISIBILITY_STATE
*/
#define HOMEKIT_SERVICE_INPUT_SOURCE HOMEKIT_APPLE_UUID2("D9")
/**
Defines that the accessory has control over television speaker
Required Characteristics:
- MUTE
Optional Characteristics:
- ACTIVE
- VOLUME
- VOLUME_CONTROL_TYPE
- VOLUME_SELECTOR
- NAME
*/
#define HOMEKIT_SERVICE_TELEVISION_SPEAKER HOMEKIT_APPLE_UUID3("113")
// MARK: - Characteristics
#define HOMEKIT_CHARACTERISTIC_ADMINISTRATOR_ONLY_ACCESS HOMEKIT_APPLE_UUID1("1")
#define HOMEKIT_DECLARE_CHARACTERISTIC_ADMINISTRATOR_ONLY_ACCESS(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_ADMINISTRATOR_ONLY_ACCESS, \
.description = "Administrator Only Access", \
.format = homekit_format_bool, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_paired_write \
| homekit_permissions_notify, \
.value = HOMEKIT_BOOL_(_value), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_AUDIO_FEEDBACK HOMEKIT_APPLE_UUID1("5")
#define HOMEKIT_DECLARE_CHARACTERISTIC_AUDIO_FEEDBACK(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_AUDIO_FEEDBACK, \
.description = "Audio Feedback", \
.format = homekit_format_bool, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_paired_write \
| homekit_permissions_notify, \
.value = HOMEKIT_BOOL_(_value), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_BRIGHTNESS HOMEKIT_APPLE_UUID1("8")
#define HOMEKIT_DECLARE_CHARACTERISTIC_BRIGHTNESS(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_BRIGHTNESS, \
.description = "Brightness", \
.format = homekit_format_int, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_paired_write \
| homekit_permissions_notify, \
.unit = homekit_unit_percentage, \
.min_value = (float[]) {0}, \
.max_value = (float[]) {100}, \
.min_step = (float[]) {1}, \
.value = HOMEKIT_INT_(_value), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_COOLING_THRESHOLD_TEMPERATURE HOMEKIT_APPLE_UUID1("D")
#define HOMEKIT_DECLARE_CHARACTERISTIC_COOLING_THRESHOLD_TEMPERATURE(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_COOLING_THRESHOLD_TEMPERATURE, \
.description = "Cooling Threshold Temperature", \
.format = homekit_format_float, \
.unit = homekit_unit_celsius, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_paired_write \
| homekit_permissions_notify, \
.min_value = (float[]) {10}, \
.max_value = (float[]) {35}, \
.min_step = (float[]) {0.1}, \
.value = HOMEKIT_FLOAT_(_value), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_CURRENT_DOOR_STATE HOMEKIT_APPLE_UUID1("E")
#define HOMEKIT_DECLARE_CHARACTERISTIC_CURRENT_DOOR_STATE(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_CURRENT_DOOR_STATE, \
.description = "Current Door State", \
.format = homekit_format_uint8, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_notify, \
.min_value = (float[]) {0}, \
.max_value = (float[]) {4}, \
.min_step = (float[]) {1}, \
.valid_values = { \
.count = 5, \
.values = (uint8_t[]) { 0, 1, 2, 3, 4 }, \
}, \
.value = HOMEKIT_UINT8_(_value), \
##__VA_ARGS__
#define HOMEKIT_CURRENT_HEATING_COOLING_STATE_OFF 0
#define HOMEKIT_CURRENT_HEATING_COOLING_STATE_HEAT 1
#define HOMEKIT_CURRENT_HEATING_COOLING_STATE_COOL 2
#define HOMEKIT_CHARACTERISTIC_CURRENT_HEATING_COOLING_STATE HOMEKIT_APPLE_UUID1("F")
#define HOMEKIT_DECLARE_CHARACTERISTIC_CURRENT_HEATING_COOLING_STATE(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_CURRENT_HEATING_COOLING_STATE, \
.description = "Current Heating Cooling State", \
.format = homekit_format_uint8, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_notify, \
.min_value = (float[]) {0}, \
.max_value = (float[]) {2}, \
.min_step = (float[]) {1}, \
.valid_values = { \
.count = 3, \
.values = (uint8_t[]) { 0, 1, 2 }, \
}, \
.value = HOMEKIT_UINT8_(_value), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_CURRENT_RELATIVE_HUMIDITY HOMEKIT_APPLE_UUID2("10")
#define HOMEKIT_DECLARE_CHARACTERISTIC_CURRENT_RELATIVE_HUMIDITY(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_CURRENT_RELATIVE_HUMIDITY, \
.description = "Current Relative Humidity", \
.format = homekit_format_float, \
.unit = homekit_unit_percentage, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_notify, \
.min_value = (float[]) {0}, \
.max_value = (float[]) {100}, \
.min_step = (float[]) {1}, \
.value = HOMEKIT_FLOAT_(_value), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_CURRENT_TEMPERATURE HOMEKIT_APPLE_UUID2("11")
#define HOMEKIT_DECLARE_CHARACTERISTIC_CURRENT_TEMPERATURE(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_CURRENT_TEMPERATURE, \
.description = "Current Temperature", \
.format = homekit_format_float, \
.unit = homekit_unit_celsius, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_notify, \
.min_value = (float[]) {0}, \
.max_value = (float[]) {100}, \
.min_step = (float[]) {0.1}, \
.value = HOMEKIT_FLOAT_(_value), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_FIRMWARE_REVISION HOMEKIT_APPLE_UUID2("52")
#define HOMEKIT_DECLARE_CHARACTERISTIC_FIRMWARE_REVISION(revision, ...) \
.type = HOMEKIT_CHARACTERISTIC_FIRMWARE_REVISION, \
.description = "Firmware Revision", \
.format = homekit_format_string, \
.permissions = homekit_permissions_paired_read, \
.value = HOMEKIT_STRING_(revision), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_HARDWARE_REVISION HOMEKIT_APPLE_UUID2("53")
#define HOMEKIT_DECLARE_CHARACTERISTIC_HARDWARE_REVISION(revision, ...) \
.type = HOMEKIT_CHARACTERISTIC_HARDWARE_REVISION, \
.description = "Hardware Revision", \
.format = homekit_format_string, \
.permissions = homekit_permissions_paired_read, \
.value = HOMEKIT_STRING_(revision), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_HEATING_THRESHOLD_TEMPERATURE HOMEKIT_APPLE_UUID2("12")
#define HOMEKIT_DECLARE_CHARACTERISTIC_HEATING_THRESHOLD_TEMPERATURE(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_HEATING_THRESHOLD_TEMPERATURE, \
.description = "Heating Threshold Temperature", \
.format = homekit_format_float, \
.unit = homekit_unit_celsius, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_paired_write \
| homekit_permissions_notify, \
.min_value = (float[]) {0}, \
.max_value = (float[]) {25}, \
.min_step = (float[]) {0.1}, \
.value = HOMEKIT_FLOAT_(_value), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_HUE HOMEKIT_APPLE_UUID2("13")
#define HOMEKIT_DECLARE_CHARACTERISTIC_HUE(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_HUE, \
.description = "Hue", \
.format = homekit_format_float, \
.unit = homekit_unit_arcdegrees, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_paired_write \
| homekit_permissions_notify, \
.min_value = (float[]) {0}, \
.max_value = (float[]) {360}, \
.min_step = (float[]) {1}, \
.value = HOMEKIT_FLOAT_(_value), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_IDENTIFY HOMEKIT_APPLE_UUID2("14")
#define HOMEKIT_DECLARE_CHARACTERISTIC_IDENTIFY(callback, ...) \
.type = HOMEKIT_CHARACTERISTIC_IDENTIFY, \
.format = homekit_format_bool, \
.permissions = homekit_permissions_paired_write, \
.description = "Identify", \
.setter = callback \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_LOCK_CONTROL_POINT HOMEKIT_APPLE_UUID2("19")
#define HOMEKIT_DECLARE_CHARACTERISTIC_LOCK_CONTROL_POINT(...) \
.type = HOMEKIT_CHARACTERISTIC_LOCK_CONTROL_POINT, \
.description = "Lock Control Point", \
.format = homekit_format_tlv, \
.permissions = homekit_permissions_paired_write, \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_LOCK_CURRENT_STATE HOMEKIT_APPLE_UUID2("1D")
#define HOMEKIT_DECLARE_CHARACTERISTIC_LOCK_CURRENT_STATE(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_LOCK_CURRENT_STATE, \
.description = "Lock Current State", \
.format = homekit_format_uint8, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_notify, \
.min_value = (float[]) {0}, \
.max_value = (float[]) {3}, \
.min_step = (float[]) {1}, \
.valid_values = { \
.count = 4, \
.values = (uint8_t[]) { 0, 1, 2, 3 }, \
}, \
.value = HOMEKIT_UINT8_(_value), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_LOCK_LAST_KNOWN_ACTION HOMEKIT_APPLE_UUID2("1C")
#define HOMEKIT_DECLARE_CHARACTERISTIC_LOCK_LAST_KNOWN_ACTION(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_LOCK_LAST_KNOWN_ACTION, \
.description = "Lock Last Known Action", \
.format = homekit_format_uint8, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_notify, \
.min_value = (float[]) {0}, \
.max_value = (float[]) {8}, \
.min_step = (float[]) {1}, \
.valid_values = { \
.count = 9, \
.values = (uint8_t[]) { 0, 1, 2, 3, 4, 5, 6, 7, 8 }, \
}, \
.value = HOMEKIT_UINT8_(_value), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_LOCK_MANAGEMENT_AUTO_SECURITY_TIMEOUT HOMEKIT_APPLE_UUID2("1A")
#define HOMEKIT_DECLARE_CHARACTERISTIC_LOCK_MANAGEMENT_AUTO_SECURITY_TIMEOUT(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_LOCK_MANAGEMENT_AUTO_SECURITY_TIMEOUT, \
.description = "Lock Management Auto Security Timeout", \
.format = homekit_format_uint32, \
.unit = homekit_unit_seconds, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_paired_write \
| homekit_permissions_notify, \
.value = HOMEKIT_UINT32_(_value), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_LOCK_TARGET_STATE HOMEKIT_APPLE_UUID2("1E")
#define HOMEKIT_DECLARE_CHARACTERISTIC_LOCK_TARGET_STATE(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_LOCK_TARGET_STATE, \
.description = "Lock Target State", \
.format = homekit_format_uint8, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_paired_write \
| homekit_permissions_notify, \
.min_value = (float[]) {0}, \
.max_value = (float[]) {1}, \
.min_step = (float[]) {1}, \
.valid_values = { \
.count = 2, \
.values = (uint8_t[]) { 0, 1 }, \
}, \
.value = HOMEKIT_UINT8_(_value), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_LOGS HOMEKIT_APPLE_UUID2("1F")
#define HOMEKIT_DECLARE_CHARACTERISTIC_LOGS(...) \
.type = HOMEKIT_CHARACTERISTIC_LOGS, \
.description = "Logs", \
.format = homekit_format_tlv, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_notify, \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_MANUFACTURER HOMEKIT_APPLE_UUID2("20")
#define HOMEKIT_DECLARE_CHARACTERISTIC_MANUFACTURER(manufacturer, ...) \
.type = HOMEKIT_CHARACTERISTIC_MANUFACTURER, \
.description = "Manufacturer", \
.format = homekit_format_string, \
.permissions = homekit_permissions_paired_read, \
.value = HOMEKIT_STRING_(manufacturer), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_MODEL HOMEKIT_APPLE_UUID2("21")
#define HOMEKIT_DECLARE_CHARACTERISTIC_MODEL(model, ...) \
.type = HOMEKIT_CHARACTERISTIC_MODEL, \
.description = "Model", \
.format = homekit_format_string, \
.permissions = homekit_permissions_paired_read, \
.value = HOMEKIT_STRING_(model), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_MOTION_DETECTED HOMEKIT_APPLE_UUID2("22")
#define HOMEKIT_DECLARE_CHARACTERISTIC_MOTION_DETECTED(_value, ...) \
.type = HOMEKIT_CHARACTERISTIC_MOTION_DETECTED, \
.description = "Motion Detected", \
.format = homekit_format_bool, \
.permissions = homekit_permissions_paired_read \
| homekit_permissions_notify, \
.value = HOMEKIT_BOOL_(_value), \
##__VA_ARGS__
#define HOMEKIT_CHARACTERISTIC_NAME HOMEKIT_APPLE_UUID2("23")
#define HOMEKIT_DECLARE_CHARACTERISTIC_NAME(name, ...) \
.type = HOMEKIT_CHARACTERISTIC_NAME, \
.description = "Name", \
.format = homekit_format_string, \
.permissions = homekit_permissions_paired_read, \
.value = HOMEKIT_STRING_(name), \
##__VA_ARGS__