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
94
95
96
//
// TuyaSmartAutoActivator.h
// TuyaSmartActivatorKit
//
// Copyright (c) 2014-2021 Tuya Inc. (https://developer.tuya.com)
 
#import <TuyaSmartDeviceKit/TuyaSmartDeviceKit.h>
 
NS_ASSUME_NONNULL_BEGIN
 
@class TuyaSmartAutoActivator;
 
@protocol TuyaSmartAutoActivatorDelegate <NSObject>
 
/// Configure callbacks for status updates of the network.
/// @param activator instance
/// @param deviceModel Device model.
/// @param error error
- (void)autoActivator:(TuyaSmartAutoActivator *)activator didReceiveAutoConfigDevice:(TuyaSmartDeviceModel *)deviceModel error:(NSError *)error;
 
@end
 
@interface TuyaSmartAutoActivator : NSObject
 
/// Return the delegate of TuyaSmartAutoActivator.
@property (nonatomic, weak) id<TuyaSmartAutoActivatorDelegate> delegate;
 
/// Returns the single of the class.
+ (instancetype)sharedInstance;
 
/// Get a list of all the devices under the current household that support password-free configuration.
/// @param homeId HomeId
/// @return Current list of all devices in the home that support password-free configuration.
- (NSArray <TuyaSmartDeviceModel *> *)autoActiveSupportedDeviceListWithHomeId:(long long)homeId;
 
/// Get the list of all gateway router devices under the current family.
/// @param homeId Current home ID.
/// @return Current list of all home gateway router devices.
/// @deprecated This method is deprecated, Use TuyaSmartRouterActivator::autoActiveRouterDeviceListWithHomeId: instead.
- (NSArray <TuyaSmartDeviceModel *> *)autoActiveRouterDeviceListWithHomeId:(long long)homeId __deprecated_msg("Use -[TuyaSmartRouterActivator autoActiveRouterDeviceListWithHomeId:] instead.");
 
/// Start discovering devices.
/// @param devIds Device Id list
/// @param timeout Timeout, default 100 seconds.
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)startDiscoverWithDevIds:(NSArray<NSString *> *)devIds
                        timeout:(NSTimeInterval)timeout
                        success:(TYSuccessHandler)success
                        failure:(TYFailureError)failure;
 
/// Obtain configuration token (valid for 10 minutes).
/// @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;
 
/// Start discovering devices.
/// @param devIds Device ID list.
/// @param token Configuration token.
/// @param timeout Timeout, default 100 seconds.
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)startDiscoverWithDevIds:(NSArray<NSString *> *)devIds
                          token:(NSString *)token
                        timeout:(NSTimeInterval)timeout
                        success:(TYSuccessHandler)success
                        failure:(TYFailureError)failure;
 
/// Start discovering gateway routers.
/// @param devIds Device ID list.
/// @param type Type,  0 to start discover device.
/// @param timeout Timeout, default 100 seconds
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
/// @deprecated This method is deprecated, Use TuyaSmartRouterActivator::startDiscoverRouterWithDevIds:type:timeout:success:failure: instead.
- (void)startDiscoverRouterWithDevIds:(NSArray<NSString *> *)devIds
                                 type:(NSInteger)type
                              timeout:(NSTimeInterval)timeout
                              success:(TYSuccessHandler)success
                              failure:(TYFailureError)failure __deprecated_msg("Use -[TuyaSmartRouterActivator startDiscoverRouterWithDevIds:type:timeout:success:failure:] instead.");
 
/// Stop discovery devices.
- (void)stopDiscover;
 
/// Binding devices to a specified home.
/// @param homeId HomeId
/// @param devIds Device ID list.
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)bindDeviceWithHomeId:(long long)homeId devIds:(NSArray <NSString *>*)devIds success:(TYSuccessHandler)success failure:(TYFailureError)failure;
 
 
@end
 
NS_ASSUME_NONNULL_END