objc2-home-kit 0.3.2

Bindings to the HomeKit framework
Documentation
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/homekit/hmhomehubstate?language=objc)
// NS_ENUM
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct HMHomeHubState(pub NSUInteger);
impl HMHomeHubState {
    #[doc(alias = "HMHomeHubStateNotAvailable")]
    pub const NotAvailable: Self = Self(0);
    #[doc(alias = "HMHomeHubStateConnected")]
    pub const Connected: Self = Self(1);
    #[doc(alias = "HMHomeHubStateDisconnected")]
    pub const Disconnected: Self = Self(2);
}

unsafe impl Encode for HMHomeHubState {
    const ENCODING: Encoding = NSUInteger::ENCODING;
}

unsafe impl RefEncode for HMHomeHubState {
    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}

extern_class!(
    /// Represents a home.
    ///
    ///
    /// This class represents a home and is the entry point to communicate and
    /// configure different accessories in the home. This is also used to manage
    /// all the rooms, zones, service groups, users, triggers, and action sets in
    /// the home.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmhome?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct HMHome;
);

unsafe impl Send for HMHome {}

unsafe impl Sync for HMHome {}

extern_conformance!(
    unsafe impl NSObjectProtocol for HMHome {}
);

impl HMHome {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        /// Delegate that receives updates on the state of the home.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(delegate))]
        #[unsafe(method_family = none)]
        pub unsafe fn delegate(&self) -> Option<Retained<ProtocolObject<dyn HMHomeDelegate>>>;

        /// Setter for [`delegate`][Self::delegate].
        ///
        /// This is a [weak property][objc2::topics::weak_property].
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(setDelegate:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setDelegate(&self, delegate: Option<&ProtocolObject<dyn HMHomeDelegate>>);

        /// The name of the home.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub unsafe fn name(&self) -> Retained<NSString>;

        /// Specifies whether this home is the primary home.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(isPrimary))]
        #[unsafe(method_family = none)]
        pub unsafe fn isPrimary(&self) -> bool;

        /// Specifies the state of the home hub.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(homeHubState))]
        #[unsafe(method_family = none)]
        pub unsafe fn homeHubState(&self) -> HMHomeHubState;

        /// A unique identifier for the home.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(uniqueIdentifier))]
        #[unsafe(method_family = none)]
        pub unsafe fn uniqueIdentifier(&self) -> Retained<NSUUID>;

        #[cfg(feature = "block2")]
        /// This method is used to change the name of the home.
        ///
        ///
        /// Parameter `name`: New name for the home.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(updateName:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn updateName_completionHandler(
            &self,
            name: &NSString,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );
    );
}

/// Methods declared on superclass `NSObject`.
impl HMHome {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

/// HMAccessory.
impl HMHome {
    extern_methods!(
        #[cfg(feature = "HMAccessory")]
        /// Array of HMAccessory objects that represents all accessories added to the home.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(accessories))]
        #[unsafe(method_family = none)]
        pub unsafe fn accessories(&self) -> Retained<NSArray<HMAccessory>>;

        #[cfg(all(feature = "HMAccessory", feature = "block2"))]
        /// Adds a new accessory to the home.
        ///
        ///
        /// Parameter `accessory`: Accessory to add to the home.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(addAccessory:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addAccessory_completionHandler(
            &self,
            accessory: &HMAccessory,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(all(feature = "HMAccessory", feature = "block2"))]
        /// Removes an accessory from the home.
        ///
        ///
        /// Parameter `accessory`: Accessory to remove from the home.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(removeAccessory:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeAccessory_completionHandler(
            &self,
            accessory: &HMAccessory,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(all(feature = "HMAccessory", feature = "HMRoom", feature = "block2"))]
        /// Assigns a new room for the accessory.
        ///
        ///
        /// When an accessory is added to a home, it is automatically assigned the room corresponding to
        /// + [HMHome roomForEntireHome]. This method is used to change the room assigned to an accessory.
        ///
        ///
        /// Parameter `accessory`: Accessory whose rooms needs to modified
        ///
        ///
        /// Parameter `room`: New room for the accessory.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(assignAccessory:toRoom:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn assignAccessory_toRoom_completionHandler(
            &self,
            accessory: &HMAccessory,
            room: &HMRoom,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(feature = "HMService")]
        /// Queries all services that match the specified types.
        ///
        ///
        /// Parameter `serviceTypes`: Array of NSString objects that specifies the service types to match.
        ///
        ///
        /// Returns: Array of HMService objects that match the specified service types,
        /// nil if no matching services were found.
        #[unsafe(method(servicesWithTypes:))]
        #[unsafe(method_family = none)]
        pub unsafe fn servicesWithTypes(
            &self,
            service_types: &NSArray<NSString>,
        ) -> Option<Retained<NSArray<HMService>>>;

        #[cfg(all(feature = "HMAccessory", feature = "block2"))]
        /// unblock a blocked accessory.
        ///
        ///
        /// A misbehaving accessory will automatically be blocked.  After that all requests to
        /// the accessory will fail.  This API must be used to explicitly unblock the accessory
        ///
        ///
        /// Parameter `accessory`: accessory to be unblocked
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(unblockAccessory:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn unblockAccessory_completionHandler(
            &self,
            accessory: &HMAccessory,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(feature = "block2")]
        /// Find nearby accessories and add them to the home. During this process, each of the accessories added
        /// to the home is assigned to a room and its services are configured.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[deprecated = "Use -[HMAccessorySetupManager performAccessorySetupUsingRequest:completionHandler:] instead"]
        #[unsafe(method(addAndSetupAccessoriesWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addAndSetupAccessoriesWithCompletionHandler(
            &self,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(all(
            feature = "HMAccessory",
            feature = "HMAccessorySetupPayload",
            feature = "block2"
        ))]
        /// Add accessory with the given setup payload to the home.
        ///
        /// Note: This SPI requires entitlement: com.apple.developer.homekit.allow-setup-payload
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// Accessories provides the list of added accessories.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[deprecated = "Use -[HMAccessorySetupManager performAccessorySetupUsingRequest:completionHandler:] instead"]
        #[unsafe(method(addAndSetupAccessoriesWithPayload:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addAndSetupAccessoriesWithPayload_completionHandler(
            &self,
            payload: &HMAccessorySetupPayload,
            completion: &block2::DynBlock<dyn Fn(*mut NSArray<HMAccessory>, *mut NSError)>,
        );

        /// True if this home supports all of the requirements for adding a network router.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(supportsAddingNetworkRouter))]
        #[unsafe(method_family = none)]
        pub unsafe fn supportsAddingNetworkRouter(&self) -> bool;
    );
}

/// HMUser.
impl HMHome {
    extern_methods!(
        #[cfg(feature = "HMUser")]
        /// HMUser object representing the current user of the home.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(currentUser))]
        #[unsafe(method_family = none)]
        pub unsafe fn currentUser(&self) -> Retained<HMUser>;

        #[cfg(feature = "HMUser")]
        /// Array of HMUser objects that represent all users associated with the home.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[deprecated = "No longer supported."]
        #[unsafe(method(users))]
        #[unsafe(method_family = none)]
        pub unsafe fn users(&self) -> Retained<NSArray<HMUser>>;

        #[cfg(feature = "block2")]
        /// Presents a view controller to manage users of the home.
        ///
        ///
        /// This API is available only for users that have administrator access to the home.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once user management is completed.
        /// The completion block is fired to allow clients to know when the user has dismissed the view.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success. If the user does not have administrator privileges the error code will be set to
        /// HMErrorCodeInsufficientPrivileges.
        #[unsafe(method(manageUsersWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn manageUsersWithCompletionHandler(
            &self,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(all(feature = "HMUser", feature = "block2"))]
        /// Adds a user to the home.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The HMUser object provides a reference to the user that was added to the home.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success. The userInfo dictionary will contain the HMUserFailedAccessoriesKey which provides
        /// more details on the accessories that failed to add the user.
        #[deprecated]
        #[unsafe(method(addUserWithCompletionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addUserWithCompletionHandler(
            &self,
            completion: &block2::DynBlock<dyn Fn(*mut HMUser, *mut NSError)>,
        );

        #[cfg(all(feature = "HMUser", feature = "block2"))]
        /// Removes a user from the home.
        ///
        ///
        /// Parameter `user`: HMUser whose access is being revoked.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success. The userInfo dictionary will contain the HMUserFailedAccessoriesKey which provides
        /// more details on the accessories that failed to remove the user.
        #[deprecated]
        #[unsafe(method(removeUser:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeUser_completionHandler(
            &self,
            user: &HMUser,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(all(
            feature = "HMAccessControl",
            feature = "HMHomeAccessControl",
            feature = "HMUser"
        ))]
        /// Retrieve the access level of the user associated with the home.
        #[unsafe(method(homeAccessControlForUser:))]
        #[unsafe(method_family = none)]
        pub unsafe fn homeAccessControlForUser(
            &self,
            user: &HMUser,
        ) -> Retained<HMHomeAccessControl>;
    );
}

/// HMRoom.
impl HMHome {
    extern_methods!(
        #[cfg(feature = "HMRoom")]
        /// Array of HMRoom objects that represents all rooms in the home.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(rooms))]
        #[unsafe(method_family = none)]
        pub unsafe fn rooms(&self) -> Retained<NSArray<HMRoom>>;

        #[cfg(all(feature = "HMRoom", feature = "block2"))]
        /// Adds a room to the home.
        ///
        ///
        /// Parameter `roomName`: Name of the room to add to the home.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The HMRoom is the new room added to the home.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(addRoomWithName:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addRoomWithName_completionHandler(
            &self,
            room_name: &NSString,
            completion: &block2::DynBlock<dyn Fn(*mut HMRoom, *mut NSError)>,
        );

        #[cfg(all(feature = "HMRoom", feature = "block2"))]
        /// Removes a room from the home.
        ///
        /// Any references to this room will be removed from all properties
        /// of the home. For example, the room will be removed from the zone.
        /// Any accessories associated contained by this room will be moved to
        /// the room provided by - [HMHome roomForEntireHome].
        ///
        ///
        /// Parameter `room`: Room to remove from the home.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(removeRoom:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeRoom_completionHandler(
            &self,
            room: &HMRoom,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(feature = "HMRoom")]
        /// This method returns a room that represents the entire home. This can be used to assign a room
        /// to a service that is not necessarily located in one particular room.
        ///
        ///
        /// Returns: HMRoom that represents the home.
        #[unsafe(method(roomForEntireHome))]
        #[unsafe(method_family = none)]
        pub unsafe fn roomForEntireHome(&self) -> Retained<HMRoom>;
    );
}

/// HMZone.
impl HMHome {
    extern_methods!(
        #[cfg(feature = "HMZone")]
        /// Array of HMZone objects that represents all the zones in the home.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(zones))]
        #[unsafe(method_family = none)]
        pub unsafe fn zones(&self) -> Retained<NSArray<HMZone>>;

        #[cfg(all(feature = "HMZone", feature = "block2"))]
        /// Adds a zone to the home.
        ///
        ///
        /// Parameter `zoneName`: Name of the zone to add to the home.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The HMZone is the new zone added to the home.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(addZoneWithName:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addZoneWithName_completionHandler(
            &self,
            zone_name: &NSString,
            completion: &block2::DynBlock<dyn Fn(*mut HMZone, *mut NSError)>,
        );

        #[cfg(all(feature = "HMZone", feature = "block2"))]
        /// Removes a zone from the home.
        ///
        ///
        /// Parameter `zone`: Zone to remove from the home.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(removeZone:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeZone_completionHandler(
            &self,
            zone: &HMZone,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );
    );
}

/// HMServiceGroup.
impl HMHome {
    extern_methods!(
        #[cfg(feature = "HMServiceGroup")]
        /// Array of HMServiceGroup objects that represents all service groups in the home.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(serviceGroups))]
        #[unsafe(method_family = none)]
        pub unsafe fn serviceGroups(&self) -> Retained<NSArray<HMServiceGroup>>;

        #[cfg(all(feature = "HMServiceGroup", feature = "block2"))]
        /// Adds a service group to the home.
        ///
        ///
        /// Parameter `serviceGroupName`: Name of the service group to add to the home.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The HMServiceGroup is the new service group added to the home.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(addServiceGroupWithName:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addServiceGroupWithName_completionHandler(
            &self,
            service_group_name: &NSString,
            completion: &block2::DynBlock<dyn Fn(*mut HMServiceGroup, *mut NSError)>,
        );

        #[cfg(all(feature = "HMServiceGroup", feature = "block2"))]
        /// Removes a service group from the home.
        ///
        ///
        /// Parameter `group`: Service group to remove from the home.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(removeServiceGroup:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeServiceGroup_completionHandler(
            &self,
            group: &HMServiceGroup,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );
    );
}

/// HMActionSet.
impl HMHome {
    extern_methods!(
        #[cfg(feature = "HMActionSet")]
        /// Array of HMActionSet objects that represents all the action sets in the home.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(actionSets))]
        #[unsafe(method_family = none)]
        pub unsafe fn actionSets(&self) -> Retained<NSArray<HMActionSet>>;

        #[cfg(all(feature = "HMActionSet", feature = "block2"))]
        /// Adds a new action set to the home.
        ///
        ///
        /// Parameter `actionSetName`: Name of the action set to add to the home.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The HMActionSet parameter is the new action set added to the home.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(addActionSetWithName:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addActionSetWithName_completionHandler(
            &self,
            action_set_name: &NSString,
            completion: &block2::DynBlock<dyn Fn(*mut HMActionSet, *mut NSError)>,
        );

        #[cfg(all(feature = "HMActionSet", feature = "block2"))]
        /// Removes an existing action set from the home.
        ///
        ///
        /// Parameter `actionSet`: Action set to remove from the home. A builtin action set cannot be removed.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(removeActionSet:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeActionSet_completionHandler(
            &self,
            action_set: &HMActionSet,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(all(feature = "HMActionSet", feature = "block2"))]
        /// Executes all the actions within an action set.
        ///
        ///
        /// Parameter `actionSet`: Action set to execute.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(executeActionSet:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn executeActionSet_completionHandler(
            &self,
            action_set: &HMActionSet,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(feature = "HMActionSet")]
        /// Retrieve a built-in action set for the home.
        ///
        ///
        /// Parameter `actionSetType`: Type of the builtin action set. Supported action set types are HMActionSetTypeWakeUp,
        /// HMActionSetTypeSleep, HMActionSetTypeHomeDeparture and HMActionSetTypeHomeArrival.
        ///
        ///
        /// Returns: Reference to the built-in action set corresponding to type argument,
        /// nil if no matching action set is found.
        #[unsafe(method(builtinActionSetOfType:))]
        #[unsafe(method_family = none)]
        pub unsafe fn builtinActionSetOfType(
            &self,
            action_set_type: &NSString,
        ) -> Option<Retained<HMActionSet>>;
    );
}

/// HMTrigger.
impl HMHome {
    extern_methods!(
        #[cfg(feature = "HMTrigger")]
        /// Array of HMTrigger objects that represents all the triggers in the home.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(triggers))]
        #[unsafe(method_family = none)]
        pub unsafe fn triggers(&self) -> Retained<NSArray<HMTrigger>>;

        #[cfg(all(feature = "HMTrigger", feature = "block2"))]
        /// Adds a trigger to the home. Unless the trigger object is added to the home, it cannot be
        /// activated. Throws error and will not be added to home if there is no Home Hub associated with the home
        ///
        ///
        /// Triggers are specific to an iOS device and are not synced across multiple devices to
        /// ensure that the action sets are executed only once.
        ///
        ///
        /// Parameter `trigger`: Trigger to add to the home.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The HMTrigger parameter is the new trigger added to the home.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        /// Errors when no Home Hub is associated with the home
        #[unsafe(method(addTrigger:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn addTrigger_completionHandler(
            &self,
            trigger: &HMTrigger,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );

        #[cfg(all(feature = "HMTrigger", feature = "block2"))]
        /// Removes a trigger from the home. If the trigger is active, they are automatically deactivated.
        ///
        ///
        /// Parameter `trigger`: Trigger to remove from the home.
        ///
        ///
        /// Parameter `completion`: Block that is invoked once the request is processed.
        /// The NSError provides more information on the status of the request, error
        /// will be nil on success.
        #[unsafe(method(removeTrigger:completionHandler:))]
        #[unsafe(method_family = none)]
        pub unsafe fn removeTrigger_completionHandler(
            &self,
            trigger: &HMTrigger,
            completion: &block2::DynBlock<dyn Fn(*mut NSError)>,
        );
    );
}

/// Matter.
impl HMHome {
    extern_methods!(
        /// Identifier of the Matter controller associated with this home.
        /// This property can be passed as the first argument to +[MTRDeviceController sharedControllerWithId:xpcConnectBlock:] method
        /// to get a MTRDeviceController object.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(matterControllerID))]
        #[unsafe(method_family = none)]
        pub unsafe fn matterControllerID(&self) -> Retained<NSString>;

        #[cfg(feature = "block2")]
        /// Block generating XPC connection on demand through which to access the Matter controller associated with this home.
        /// This property can be passed as the second argument to +[MTRDeviceController sharedControllerWithId:xpcConnectBlock:] method
        /// to get a MTRDeviceController object.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(matterControllerXPCConnectBlock))]
        #[unsafe(method_family = none)]
        pub unsafe fn matterControllerXPCConnectBlock(
            &self,
        ) -> NonNull<block2::DynBlock<dyn Fn() -> NonNull<NSXPCConnection>>>;

        #[cfg(feature = "block2")]
        /// Block generating XPC connection on demand through which to access the Matter controller associated with this home.
        /// This property can be passed as part of an MTRXPCDeviceControllerParameters to create an MTRDeviceController that will have access to the Apple Home Fabric.
        ///
        /// This property is not atomic.
        ///
        /// # Safety
        ///
        /// This might not be thread-safe.
        #[unsafe(method(matterStartupParametersXPCConnectBlock))]
        #[unsafe(method_family = none)]
        pub unsafe fn matterStartupParametersXPCConnectBlock(
            &self,
        ) -> NonNull<block2::DynBlock<dyn Fn() -> NonNull<NSXPCConnection>>>;
    );
}

extern_protocol!(
    /// This delegate receives update on the various accessories, action sets, groups and triggers
    /// managed in the home.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmhomedelegate?language=objc)
    pub unsafe trait HMHomeDelegate: NSObjectProtocol {
        /// Informs the delegate of a change in the name of a home.
        ///
        ///
        /// Parameter `home`: Sender of this message.
        #[optional]
        #[unsafe(method(homeDidUpdateName:))]
        #[unsafe(method_family = none)]
        unsafe fn homeDidUpdateName(&self, home: &HMHome);

        /// Informs the delegate when the access control for current user has been updated.
        ///
        ///
        /// Parameter `home`: Sender of the message.
        #[optional]
        #[unsafe(method(homeDidUpdateAccessControlForCurrentUser:))]
        #[unsafe(method_family = none)]
        unsafe fn homeDidUpdateAccessControlForCurrentUser(&self, home: &HMHome);

        #[cfg(feature = "HMAccessory")]
        /// Informs the delegate of addition of an accessory to the home.
        ///
        ///
        /// Parameter `home`: Sender of the message.
        ///
        ///
        /// Parameter `accessory`: Accessory that was added to the home.
        #[optional]
        #[unsafe(method(home:didAddAccessory:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didAddAccessory(&self, home: &HMHome, accessory: &HMAccessory);

        #[cfg(feature = "HMAccessory")]
        /// Informs the delegate of removal of an accessory from the home.
        ///
        ///
        /// Parameter `home`: Sender of the message.
        ///
        ///
        /// Parameter `accessory`: Accessory that was removed from the home.
        #[optional]
        #[unsafe(method(home:didRemoveAccessory:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didRemoveAccessory(&self, home: &HMHome, accessory: &HMAccessory);

        #[cfg(feature = "HMUser")]
        /// Informs the delegate that a user was added to the home.
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `user`: User who was granted access to the home.
        #[optional]
        #[unsafe(method(home:didAddUser:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didAddUser(&self, home: &HMHome, user: &HMUser);

        #[cfg(feature = "HMUser")]
        /// Informs the delegate that a user was removed from the home.
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `user`: User whose access was revoked from the home.
        #[optional]
        #[unsafe(method(home:didRemoveUser:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didRemoveUser(&self, home: &HMHome, user: &HMUser);

        #[cfg(all(feature = "HMAccessory", feature = "HMRoom"))]
        /// Informs the delegate when a new room is assigned to an accessory
        ///
        ///
        /// Parameter `home`: Sender of the message.
        ///
        ///
        /// Parameter `room`: New room for the accessory.
        ///
        ///
        /// Parameter `accessory`: Accessory that was assigned a new room.
        #[optional]
        #[unsafe(method(home:didUpdateRoom:forAccessory:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didUpdateRoom_forAccessory(
            &self,
            home: &HMHome,
            room: &HMRoom,
            accessory: &HMAccessory,
        );

        #[cfg(feature = "HMRoom")]
        /// Informs the delegate of addition of a room to the home.
        ///
        ///
        /// Parameter `home`: Sender of the message.
        ///
        ///
        /// Parameter `room`: Room that was added to the home.
        #[optional]
        #[unsafe(method(home:didAddRoom:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didAddRoom(&self, home: &HMHome, room: &HMRoom);

        #[cfg(feature = "HMRoom")]
        /// Informs the delegate of removal of a room from the home.
        ///
        ///
        /// Parameter `home`: Sender of the message.
        ///
        ///
        /// Parameter `room`: Room that was removed from the home.
        #[optional]
        #[unsafe(method(home:didRemoveRoom:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didRemoveRoom(&self, home: &HMHome, room: &HMRoom);

        #[cfg(feature = "HMRoom")]
        /// Informs the delegate that the name of a room was modified
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `room`: Room that was modified.
        #[optional]
        #[unsafe(method(home:didUpdateNameForRoom:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didUpdateNameForRoom(&self, home: &HMHome, room: &HMRoom);

        #[cfg(feature = "HMZone")]
        /// Informs the delegate of addition of a zone to the home.
        ///
        ///
        /// Parameter `home`: Sender of the message.
        ///
        ///
        /// Parameter `zone`: Zone that was added to the home.
        #[optional]
        #[unsafe(method(home:didAddZone:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didAddZone(&self, home: &HMHome, zone: &HMZone);

        #[cfg(feature = "HMZone")]
        /// Informs the delegate of removal of a zone from the home.
        ///
        ///
        /// Parameter `home`: Sender of the message.
        ///
        ///
        /// Parameter `zone`: Zone that was removed from the home.
        #[optional]
        #[unsafe(method(home:didRemoveZone:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didRemoveZone(&self, home: &HMHome, zone: &HMZone);

        #[cfg(feature = "HMZone")]
        /// Informs the delegate that the name of a zone was modified.
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `zone`: Zone that was modified.
        #[optional]
        #[unsafe(method(home:didUpdateNameForZone:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didUpdateNameForZone(&self, home: &HMHome, zone: &HMZone);

        #[cfg(all(feature = "HMRoom", feature = "HMZone"))]
        /// Informs the delegate that the room was added to a zone.
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `room`: Room that was added to the zone.
        ///
        ///
        /// Parameter `zone`: Zone that was modified.
        #[optional]
        #[unsafe(method(home:didAddRoom:toZone:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didAddRoom_toZone(&self, home: &HMHome, room: &HMRoom, zone: &HMZone);

        #[cfg(all(feature = "HMRoom", feature = "HMZone"))]
        /// Informs the delegate that the room was removed from a zone.
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `room`: Room that was removed from the zone.
        ///
        ///
        /// Parameter `zone`: Zone that was modified.
        #[optional]
        #[unsafe(method(home:didRemoveRoom:fromZone:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didRemoveRoom_fromZone(&self, home: &HMHome, room: &HMRoom, zone: &HMZone);

        #[cfg(feature = "HMServiceGroup")]
        /// Informs the delegate that a service group was added to the home.
        ///
        ///
        /// Parameter `home`: Sender of the message.
        ///
        ///
        /// Parameter `group`: Service group that was added to the home.
        #[optional]
        #[unsafe(method(home:didAddServiceGroup:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didAddServiceGroup(&self, home: &HMHome, group: &HMServiceGroup);

        #[cfg(feature = "HMServiceGroup")]
        /// Informs the delegate that a service group was removed from the home.
        ///
        ///
        /// Parameter `home`: Sender of the message.
        ///
        ///
        /// Parameter `group`: Service group that was removed from the home.
        #[optional]
        #[unsafe(method(home:didRemoveServiceGroup:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didRemoveServiceGroup(&self, home: &HMHome, group: &HMServiceGroup);

        #[cfg(feature = "HMServiceGroup")]
        /// Informs the delegate that the name of a service group was modified.
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `group`: The service group that was modified.
        #[optional]
        #[unsafe(method(home:didUpdateNameForServiceGroup:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didUpdateNameForServiceGroup(&self, home: &HMHome, group: &HMServiceGroup);

        #[cfg(all(feature = "HMService", feature = "HMServiceGroup"))]
        /// Informs the delegate that a service was added to a service group.
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `service`: Service that was added to the service group.
        ///
        ///
        /// Parameter `group`: Service group that was modified.
        #[optional]
        #[unsafe(method(home:didAddService:toServiceGroup:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didAddService_toServiceGroup(
            &self,
            home: &HMHome,
            service: &HMService,
            group: &HMServiceGroup,
        );

        #[cfg(all(feature = "HMService", feature = "HMServiceGroup"))]
        /// Informs the delegate that a service was removed from a service group.
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `service`: Service that was removed from the service group.
        ///
        ///
        /// Parameter `group`: Service group that was modified.
        #[optional]
        #[unsafe(method(home:didRemoveService:fromServiceGroup:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didRemoveService_fromServiceGroup(
            &self,
            home: &HMHome,
            service: &HMService,
            group: &HMServiceGroup,
        );

        #[cfg(feature = "HMActionSet")]
        /// Informs the delegate that an action set was added to the home.
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `actionSet`: Action set that was added to the home.
        #[optional]
        #[unsafe(method(home:didAddActionSet:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didAddActionSet(&self, home: &HMHome, action_set: &HMActionSet);

        #[cfg(feature = "HMActionSet")]
        /// Informs the delegate that an action set was removed from the home.
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `actionSet`: Action set that was removed from the home.
        #[optional]
        #[unsafe(method(home:didRemoveActionSet:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didRemoveActionSet(&self, home: &HMHome, action_set: &HMActionSet);

        #[cfg(feature = "HMActionSet")]
        /// Informs the delegate that the name of an action set was modified.
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `actionSet`: Action set that was modified.
        #[optional]
        #[unsafe(method(home:didUpdateNameForActionSet:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didUpdateNameForActionSet(&self, home: &HMHome, action_set: &HMActionSet);

        #[cfg(feature = "HMActionSet")]
        /// Informs the delegate that the actions of an action set was modified.
        /// This indicates that an action was added/removed or modified (value replaced)
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `actionSet`: Action set that was modified.
        #[optional]
        #[unsafe(method(home:didUpdateActionsForActionSet:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didUpdateActionsForActionSet(&self, home: &HMHome, action_set: &HMActionSet);

        #[cfg(feature = "HMTrigger")]
        /// Informs the delegate of the addition of a trigger to the home.
        ///
        ///
        /// Parameter `home`: Sender of the message.
        ///
        ///
        /// Parameter `trigger`: Trigger that was added to the home.
        #[optional]
        #[unsafe(method(home:didAddTrigger:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didAddTrigger(&self, home: &HMHome, trigger: &HMTrigger);

        #[cfg(feature = "HMTrigger")]
        /// Informs the delegate of removal of a trigger from the home.
        ///
        ///
        /// Parameter `home`: Sender of the message.
        ///
        ///
        /// Parameter `trigger`: Trigger that was removed from the home.
        #[optional]
        #[unsafe(method(home:didRemoveTrigger:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didRemoveTrigger(&self, home: &HMHome, trigger: &HMTrigger);

        #[cfg(feature = "HMTrigger")]
        /// Informs the delegate that the name of the trigger was modified.
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `trigger`: Trigger that was modified.
        #[optional]
        #[unsafe(method(home:didUpdateNameForTrigger:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didUpdateNameForTrigger(&self, home: &HMHome, trigger: &HMTrigger);

        #[cfg(feature = "HMTrigger")]
        /// Informs the delegate whenever a trigger is updated. For example, this method may be
        /// invoked when a trigger is activated, when a trigger fires, or when the action sets
        /// associated with a trigger are modified.
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `trigger`: The trigger that was updated.
        #[optional]
        #[unsafe(method(home:didUpdateTrigger:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didUpdateTrigger(&self, home: &HMHome, trigger: &HMTrigger);

        #[cfg(feature = "HMAccessory")]
        /// Informs the delegate that an accessory has been unblocked
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `accessory`: Accessory that was unblocked
        #[optional]
        #[unsafe(method(home:didUnblockAccessory:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didUnblockAccessory(&self, home: &HMHome, accessory: &HMAccessory);

        #[cfg(feature = "HMAccessory")]
        /// Informs the delegate that a configured accessory encountered an error. The
        /// delegate should check the blocked state of the accessory
        ///
        ///
        /// Parameter `home`: Sender of this message.
        ///
        ///
        /// Parameter `error`: Error encountered by accessory.
        ///
        ///
        /// Parameter `accessory`: Accessory that encountered the error
        #[optional]
        #[unsafe(method(home:didEncounterError:forAccessory:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didEncounterError_forAccessory(
            &self,
            home: &HMHome,
            error: &NSError,
            accessory: &HMAccessory,
        );

        /// Informs the delegate when state of the home hub changes.
        ///
        ///
        /// Parameter `home`: Sender of the message.
        ///
        ///
        /// Parameter `homeHubState`: The new home hub state.
        #[optional]
        #[unsafe(method(home:didUpdateHomeHubState:))]
        #[unsafe(method_family = none)]
        unsafe fn home_didUpdateHomeHubState(&self, home: &HMHome, home_hub_state: HMHomeHubState);

        /// Informs the delegate when the supported features of this home changes.
        ///
        /// The supported features covered by this are currently:
        /// - supportsAddingNetworkRouter
        ///
        ///
        /// Parameter `home`: Sender of the message.
        #[optional]
        #[unsafe(method(homeDidUpdateSupportedFeatures:))]
        #[unsafe(method_family = none)]
        unsafe fn homeDidUpdateSupportedFeatures(&self, home: &HMHome);
    }
);

extern "C" {
    /// Key that provides more details on the accessories that failed during an
    /// addUser:completionHandler: or removeUser:completionHandler: call.
    ///
    ///
    /// The value associated with this key is an NSArray of NSDictionary objects. Each dictionary
    /// contains the UUID of the accessory that failed to the added/removed and the value
    /// corresponding to the dictionary key is an NSError that provides more details on the
    /// underlying error for that accessory.
    ///
    /// See also [Apple's documentation](https://developer.apple.com/documentation/homekit/hmuserfailedaccessorieskey?language=objc)
    pub static HMUserFailedAccessoriesKey: &'static NSString;
}