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
//
// TuyaSmartMultiControl.h
// TuyaSmartDeviceKit
//
// Copyright (c) 2014-2021 Tuya Inc. (https://developer.tuya.com)
 
#import <Foundation/Foundation.h>
#import "TuyaSmartMultiControlLinkModel.h"
#import "TuyaSmartMultiControlModel.h"
#import "TuyaSmartMultiControlDpRelationModel.h"
#import "TuyaSmartMultiControlDeviceModel.h"
 
NS_ASSUME_NONNULL_BEGIN
 
@interface TuyaSmartMultiControl : NSObject
 
/// Query the multiple controls and automation associated with the dp button under the device.
/// @param devId Main device ID.
/// @param dpId DP ID.
/// @param success Called when the task finishes successfully. TuyaSmartMultiControlLinkModel will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)queryDeviceLinkInfoWithDevId:(NSString *)devId
                                dpId:(NSString *)dpId
                             success:(void (^)(TuyaSmartMultiControlLinkModel *))success
                             failure:(TYFailureError)failure;
 
/// Adding a multi-control group.
/// @param devId Main device ID.
/// @param groupName The group name.
/// @param groupDetail Multi-control group association details.
/// @param success Called when the task finishes successfully. TuyaSmartMultiControlModel will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)addMultiControlWithDevId:(NSString *)devId
                       groupName:(NSString *)groupName
                     groupDetail:(NSArray<TuyaSmartMultiControlDetailModel *> *)groupDetail
                         success:(void (^)(TuyaSmartMultiControlModel *))success
                         failure:(TYFailureError)failure;
 
//// Update multi-Control group.
/// @param devId Main device ID.
/// @param model Multi-control group data model.
/// @param success Called when the task finishes successfully. TuyaSmartMultiControlModel will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)updateMultiControlWithDevId:(NSString *)devId
                  multiControlModel:(TuyaSmartMultiControlModel *)model
                            success:(void (^)(TuyaSmartMultiControlModel *))success
                            failure:(TYFailureError)failure;
 
/// Get dp point information of attached devices, associated multi-control, scene automation information.
/// @param devId The device ID.
/// @param success Called when the task finishes successfully. TuyaSmartMultiControlDpRelationModel will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)queryDeviceDpRelationWithDevId:(NSString *)devId
                               success:(void (^)(TuyaSmartMultiControlDpRelationModel *))success
                               failure:(TYFailureError)failure;
 
 
/// Enable or disable multiple control groups.
/// @param multiControlId Multi-control group ID.
/// @param enable A boolean value indicates whether to enable or disable the group.
/// @param success Called when the task finishes successfully.
/// @param failure Called when the task is interrupted by an error.
- (void)enableMultiControlWithMultiControlId:(NSString *)multiControlId
                                      enable:(BOOL)enable
                                     success:(TYSuccessBOOL)success
                                     failure:(TYFailureError)failure;
 
 
/// Query the list of device IDs and the list of device groups (including user's and family's) that support performing actions.
/// @param homeId The home ID.
/// @param success Called when the task finishes successfully. A list of TuyaSmartMultiControlDeviceModel will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)getMultiControlDeviceListWithHomeId:(long long)homeId
                                    success:(void (^)(NSArray<TuyaSmartMultiControlDeviceModel *> *))success
                                    failure:(TYFailureError)failure;
 
 
/// Get information about all dp points under the device.
/// @param devId The device ID.
/// @param success Called when the task finishes successfully. A list of TuyaSmartMultiControlDatapointModel will be returned.
/// @param failure Called when the task is interrupted by an error.
- (void)getDeviceDpInfoWithDevId:(NSString *)devId
                         success:(void (^)(NSArray<TuyaSmartMultiControlDatapointModel *> *))success
                         failure:(TYFailureError)failure;
 
@end
 
NS_ASSUME_NONNULL_END