Tuya iOS Smart Life App SDK 5.15.0
ThingSmartHomeKitUtil Class Reference

#import <ThingSmartHomeKitUtil.h>

Inheritance diagram for ThingSmartHomeKitUtil:

Instance Methods

(void) - homeKitDataCompletionHandler:
 
(void) - homesUpdatedHandler:
 
(HMHome *) - primaryHome
 
(NSArray< HMHome * > *) - homes
 
(NSArray< ThingSmartHomeKitDevice * > *) - devices
 
(NSArray< ThingSmartHomeKitDevice * > *) - devicesForHome:
 
(NSArray< ThingSmartHomeKitDevice * > *) - thingAndMatterDevicesForHome:
 
(void) - addAccessoryToPrimaryHomeCompletionHandler:
 
(void) - addAccessoryToPrimaryHomeWithSetupViewControllerDidLoadHandler:completionHandler:
 
(void) - addAccessoryToHome:completionHandler:
 
(void) - addAccessoryToHome:setUpViewControllerDidLoadHandler:completionHandler:
 
(void) - removeAccessory:fromHome:completionHandler:
 
(void) - homeKitDataCompletionHandler:
 
(void) - homesUpdatedHandler:
 
(HMHome *) - primaryHome
 
(NSArray< HMHome * > *) - homes
 
(NSArray< ThingSmartHomeKitDevice * > *) - devices
 
(NSArray< ThingSmartHomeKitDevice * > *) - devicesForHome:
 
(NSArray< ThingSmartHomeKitDevice * > *) - thingAndMatterDevicesForHome:
 
(void) - addAccessoryToPrimaryHomeCompletionHandler:
 
(void) - addAccessoryToPrimaryHomeWithSetupViewControllerDidLoadHandler:completionHandler:
 
(void) - addAccessoryToHome:completionHandler:
 
(void) - addAccessoryToHome:setUpViewControllerDidLoadHandler:completionHandler:
 
(void) - removeAccessory:fromHome:completionHandler:
 

Class Methods

(NSArray< ThingSmartHomeKitDevice * > *) + devicesForHomeManager:
 
(NSArray< ThingSmartHomeKitDevice * > *) + devicesForHomeManager:
 

Properties

HMHomeManager * homeManager
 

Detailed Description

Definition at line 19 of file ThingSmartHomeKitUtil.h.

Method Documentation

◆ addAccessoryToHome:completionHandler: [1/2]

- (void) addAccessoryToHome: (HMHome *)  home
completionHandler: (void(^)(NSError *__nullable error))  completion 

Adding accessory to designated home.

Parameters
homeThe designated home.
completionAccessory addition result call back handler.

◆ addAccessoryToHome:completionHandler: [2/2]

- (void) addAccessoryToHome: (HMHome *)  home
completionHandler: (void(^)(NSError *__nullable error))  completion 

Adding accessory to designated home.

Parameters
homeThe designated home.
completionAccessory addition result call back handler.

◆ addAccessoryToHome:setUpViewControllerDidLoadHandler:completionHandler: [1/2]

- (void) addAccessoryToHome: (HMHome *)  home
setUpViewControllerDidLoadHandler: (void(^)(void))  viewControllerDidLoad
completionHandler: (void(^)(NSError *__nullable error))  completion 

Adding accessory to designated home.

Parameters
homeThe designated home.
viewControllerDidLoadHomeKit Accessory setup view controller did load.
completionAccessory addition result call back handler.

◆ addAccessoryToHome:setUpViewControllerDidLoadHandler:completionHandler: [2/2]

- (void) addAccessoryToHome: (HMHome *)  home
setUpViewControllerDidLoadHandler: (void(^)(void))  viewControllerDidLoad
completionHandler: (void(^)(NSError *__nullable error))  completion 

Adding accessory to designated home.

Parameters
homeThe designated home.
viewControllerDidLoadHomeKit Accessory setup view controller did load.
completionAccessory addition result call back handler.

◆ addAccessoryToPrimaryHomeCompletionHandler: [1/2]

- (void) addAccessoryToPrimaryHomeCompletionHandler: (void(^)(NSError *__nullable error))  completion

Adding accessory to primary home.

Parameters
completionAccessory addition result call back handler.

◆ addAccessoryToPrimaryHomeCompletionHandler: [2/2]

- (void) addAccessoryToPrimaryHomeCompletionHandler: (void(^)(NSError *__nullable error))  completion

Adding accessory to primary home.

Parameters
completionAccessory addition result call back handler.

◆ addAccessoryToPrimaryHomeWithSetupViewControllerDidLoadHandler:completionHandler: [1/2]

- (void) addAccessoryToPrimaryHomeWithSetupViewControllerDidLoadHandler: (void(^)(void))  viewControllerDidLoad
completionHandler: (void(^)(NSError *__nullable error))  completion 

Display the HomeKit setup code of the device when adding accessory to primary home.

Parameters
viewControllerDidLoadHomeKit Accessory setup view controller did load.
completionAccessory addition result call back handler.

◆ addAccessoryToPrimaryHomeWithSetupViewControllerDidLoadHandler:completionHandler: [2/2]

- (void) addAccessoryToPrimaryHomeWithSetupViewControllerDidLoadHandler: (void(^)(void))  viewControllerDidLoad
completionHandler: (void(^)(NSError *__nullable error))  completion 

Display the HomeKit setup code of the device when adding accessory to primary home.

Parameters
viewControllerDidLoadHomeKit Accessory setup view controller did load.
completionAccessory addition result call back handler.

◆ devices [1/2]

- (NSArray< ThingSmartHomeKitDevice * > *) devices

Enumerate all Thing devices @discussion When a new home manager is created, this array is inialized as an empty array. It is not guaranteed to be filled with the list of devices, represented as ThingSmartHomeKitDevice objects, until the homeManagerDidUpdateHomes: delegate method has been invoked.

Returns
Find all Thing device in HomeKit.

◆ devices [2/2]

- (NSArray< ThingSmartHomeKitDevice * > *) devices

Enumerate all Thing devices @discussion When a new home manager is created, this array is inialized as an empty array. It is not guaranteed to be filled with the list of devices, represented as ThingSmartHomeKitDevice objects, until the homeManagerDidUpdateHomes: delegate method has been invoked.

Returns
Find all Thing device in HomeKit.

◆ devicesForHome: [1/2]

- (NSArray< ThingSmartHomeKitDevice * > *) devicesForHome: (HMHome *)  home

Enumerate Home devices

Returns
Find Home devices in HomeKit.

◆ devicesForHome: [2/2]

- (NSArray< ThingSmartHomeKitDevice * > *) devicesForHome: (HMHome *)  home

Enumerate Home devices

Returns
Find Home devices in HomeKit.

◆ devicesForHomeManager: [1/2]

+ (NSArray< ThingSmartHomeKitDevice * > *) devicesForHomeManager: (HMHomeManager *)  manager

Enumerate all Thing device.

Parameters
managerAny HMHomeManager object.
Returns
Find all Thing device in HomeKit.

◆ devicesForHomeManager: [2/2]

+ (NSArray< ThingSmartHomeKitDevice * > *) devicesForHomeManager: (HMHomeManager *)  manager

Enumerate all Thing device.

Parameters
managerAny HMHomeManager object.
Returns
Find all Thing device in HomeKit.

◆ homeKitDataCompletionHandler: [1/2]

- (void) homeKitDataCompletionHandler: (ThingSmartHomeKitDataCompletionHandler completionHandler

When HomeKit data has loaded.

Parameters
completionHandlerCall back until the homeManagerDidUpdateHomes: delegate method has been invoked.
Note
If the homeManagerDidUpdateHomes: delegate method has been invoked, completionHandler will be called directly.
HomeKit data is empty when homeManager is created for the first time.
This method needs to be called once to ensure that the data can be retrieved successfully.

◆ homeKitDataCompletionHandler: [2/2]

- (void) homeKitDataCompletionHandler: (ThingSmartHomeKitDataCompletionHandler completionHandler

When HomeKit data has loaded.

Parameters
completionHandlerCall back until the homeManagerDidUpdateHomes: delegate method has been invoked.
Note
If the homeManagerDidUpdateHomes: delegate method has been invoked, completionHandler will be called directly.
HomeKit data is empty when homeManager is created for the first time.
This method needs to be called once to ensure that the data can be retrieved successfully.

◆ homes [1/2]

- (NSArray< HMHome * > *) homes

Enumerate all Homes @discussion When a new home manager is created, this array is inialized as an empty array. It is not guaranteed to be filled with the list of homes, represented as HMHome objects, until the homeManagerDidUpdateHomes: delegate method has been invoked.

Returns
Find all Homes in HomeKit.

◆ homes [2/2]

- (NSArray< HMHome * > *) homes

Enumerate all Homes @discussion When a new home manager is created, this array is inialized as an empty array. It is not guaranteed to be filled with the list of homes, represented as HMHome objects, until the homeManagerDidUpdateHomes: delegate method has been invoked.

Returns
Find all Homes in HomeKit.

◆ homesUpdatedHandler: [1/2]

- (void) homesUpdatedHandler: (ThingSmartHomeKitHomesUpdatedHandler updateHandler

When HomeKit homes has udpated.

Parameters
updateHandlerCall back handler.
Note
When HomeKit homes update, will call back this handler. see <HMHomeManagerDelegate>

◆ homesUpdatedHandler: [2/2]

- (void) homesUpdatedHandler: (ThingSmartHomeKitHomesUpdatedHandler updateHandler

When HomeKit homes has udpated.

Parameters
updateHandlerCall back handler.
Note
When HomeKit homes update, will call back this handler. see <HMHomeManagerDelegate>

◆ primaryHome [1/2]

- (HMHome *) primaryHome

The primary home in HomeKit.

Returns
the primary home

◆ primaryHome [2/2]

- (HMHome *) primaryHome

The primary home in HomeKit.

Returns
the primary home

◆ removeAccessory:fromHome:completionHandler: [1/2]

- (void) removeAccessory: (HMAccessory *)  accessory
fromHome: (HMHome *)  home
completionHandler: (void(^)(NSError *__nullable error))  completion 

remove accessory from designated home.

Parameters
accessoryThe accessory to be removed.
homeThe designated home.
completionCall back handler.

◆ removeAccessory:fromHome:completionHandler: [2/2]

- (void) removeAccessory: (HMAccessory *)  accessory
fromHome: (HMHome *)  home
completionHandler: (void(^)(NSError *__nullable error))  completion 

remove accessory from designated home.

Parameters
accessoryThe accessory to be removed.
homeThe designated home.
completionCall back handler.

◆ thingAndMatterDevicesForHome: [1/2]

- (NSArray< ThingSmartHomeKitDevice * > *) thingAndMatterDevicesForHome: (HMHome *)  home

Enumerate Home devices and Matter devices

Returns
Find Home devices and Matter devices in HomeKit.

◆ thingAndMatterDevicesForHome: [2/2]

- (NSArray< ThingSmartHomeKitDevice * > *) thingAndMatterDevicesForHome: (HMHome *)  home

Enumerate Home devices and Matter devices

Returns
Find Home devices and Matter devices in HomeKit.

Property Documentation

◆ homeManager

- (HMHomeManager *) homeManager
readnonatomicstrong

Definition at line 21 of file ThingSmartHomeKitUtil.h.


The documentation for this class was generated from the following files: