1
wei
2021-01-21 62d098cb78296feaa6f786a20748921338db838c
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
//
// TuyaSmartHomeKitActivator.h
// TuyaSmartActivatorKit
//
// Copyright (c) 2014-2021 Tuya Inc. (https://developer.tuya.com)
 
#import <Foundation/Foundation.h>
#import <TuyaSmartUtil/TuyaSmartUtil.h>
#import <TuyaSmartDeviceKit/TuyaSmartDeviceKit.h>
NS_ASSUME_NONNULL_BEGIN
 
 
@class TuyaSmartHomeKitActivator;
@protocol TuyaSmartHomeKitActivatorDelegate <NSObject>
 
/// Configure callbacks for network status updates.
/// @param activator instance
/// @param deviceModel The device model.
/// @param error error
- (void)homeKitActivator:(TuyaSmartHomeKitActivator *)activator didReceiveHomeKitDevice:(TuyaSmartDeviceModel *)deviceModel error:(NSError *)error;
@end
 
@interface TuyaSmartHomeKitActivator : NSObject
 
///Returns the singleton of the class.
+ (instancetype)sharedInstance;
 
@property (nonatomic, weak) id<TuyaSmartHomeKitActivatorDelegate> delegate;
 
/// Get the HomeKit device configuration token.
/// @param success Called when the task finishes successfully. TYSuccessString will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)getTokenSuccess:(TYSuccessString)success failure:(TYFailureError)failure;
 
 
/// Get the token of the homeKit device wiring network.
/// @param homeID The home id
/// @param success Called when the task finishes successfully. token will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)getTokenWithHomeID:(long long)homeID Success:(TYSuccessString)success failure:(TYFailureError)failure;
 
 
/// Search for HomeKit devices.
/// @param timeout Timeout time.
/// @param token Configuration token.
/// @param success Called when the task finishes successfully. TuyaSmartDeviceModel will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)startDiscoverHomeKitDeviceWithTimeout:(NSTimeInterval)timeout token:(NSString *)token success:(void (^)(TuyaSmartDeviceModel *))success failure:(TYFailureError)failure;
 
/// Search for HomeKit device.
/// @param timeout Timeout time.
/// @param token Configuration token.
/// @param success Called when the task finishes successfully. TuyaSmartDeviceModel will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)startDiscoverHomeKitDeviceWithTimeout:(NSTimeInterval)timeout token:(NSString *)token success:(void (^)(TuyaSmartDeviceModel *))success failure:(TYFailureError)failure;
 
 
/// Search for HomeKit device.
/// @param timeout Timeout time.
/// @param success Called when the task finishes successfully. TYSuccessString will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)startDiscoverHomeKitDeviceWithTimeout:(NSTimeInterval)timeout success:(TYSuccessString)success failure:(TYFailureError)failure;
 
 
/// Binding HomeKit devices to the home.
/// @param homeId The home ID.
/// @param devIds A list of device IDs.
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)bindHomeKitDeviceWithHomeId:(long long)homeId devIds:(NSArray <NSString *>*)devIds success:(TYSuccessHandler)success failure:(TYFailureError)failure;
 
 
/// Get device information based on pid.
/// @param productId The product ID.
/// @param success Called when the task finishes successfully. TYSuccessDict will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)getHomekitDeviceInfoWithProductId:(NSString *)productId success:(TYSuccessDict)success failure:(TYFailureError)failure;
 
 
/// Get device information based on pid.
/// @param productId The product ID.
/// @param uuid The device uuid
/// @param success Called when the task finishes successfully. TYSuccessDict will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)getHomekitDeviceInfoWithProductId:(NSString *)productId uuid:(NSString *)uuid success:(TYSuccessDict)success failure:(TYFailureError)failure;
 
 
/// Stop discovery devices.
- (void)stopDiscover;
 
@end
 
NS_ASSUME_NONNULL_END