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
//
//  TuyaSmartSceneActionFactory.h
//  TuyaSmartSceneKit
//
//  Copyright (c) 2014-2021 Tuya Inc. (https://developer.tuya.com)
 
#import <Foundation/Foundation.h>
#import <TuyaSmartSceneKit/TuyaSmartSceneKit.h>
/// The two types of automation state. Provides enable and disable types.
typedef enum : NSInteger {
    /// The enable type.
    kAutoSwitchTypeEnable,
    /// The disable type.
    kAutoSwitchTypeDisable
}AutoSwitchType;
 
NS_ASSUME_NONNULL_BEGIN
 
/// @brief A factory design mode for create TuyaSmartSceneActionModel.
///
/// @note In order to facilitate the handling of multiple languages, this class does not handle the actionDisplay and actionDisplayNew fields of the TuyaSmartSceneActionModel. These two properties are spliced by the developer themselves when they are created. When saving, the server will generate them according to the executiveProperty and the language environment of the interface. The property saved by the developer will not be used.
@interface TuyaSmartSceneActionFactory : NSObject
 
/// Create a device action with all param.
///
/// @param devId The device id.
/// @param devName The device name.
/// @param executerProperty Action to execute, format:{dpId: <dpId's value>} eg: {"1":true}.
/// @param extraProperty The  optional parameters, extraProperty of action.
///
/// @return TuyaSmartSceneActionModel
+ (TuyaSmartSceneActionModel *)createDeviceDpActionWithDevId:(NSString *)devId devName:(NSString *)devName executerProperty:(NSDictionary *)executerProperty extraProperty:(NSDictionary *)extraProperty;
 
/// Create a group action with group's params.
///
/// @param groupId The group id.
/// @param groupName The group name.
/// @param executerProperty Action to execute, format:{dpId: <dpId's value>} eg: {"1":true}.
/// @param extraProperty The  optional parameters, extraProperty of action.
///
/// @return TuyaSmartSceneActionModel
+ (TuyaSmartSceneActionModel *)createGroupDpActionWithGroupId:(NSString *)groupId groupName:(NSString *)groupName executerProperty:(NSDictionary *)executerProperty extraProperty:(NSDictionary *)extraProperty;
 
/// Create an action to trigger a scene.
///
/// @param sceneId The sceneId id.
/// @param sceneName The sceneName name.
///
/// @return TuyaSmartSceneActionModel
+ (TuyaSmartSceneActionModel *)createTriggerSceneActionWithSceneId:(NSString *)sceneId sceneName:(NSString *)sceneName;
 
/// Create an action to enable/disable an automation.
///
/// @param sceneId The sceneId id.
/// @param sceneName The sceneName name.
/// @param type AutoSwitchType.
///
/// @return TuyaSmartSceneActionModel
+ (TuyaSmartSceneActionModel *)createSwitchAutoActionWithSceneId:(NSString *)sceneId sceneName:(NSString *)sceneName type:(AutoSwitchType)type;
 
/// Create a delay action.
///
/// @param hours hours,range 0-5
/// @param minutes minutes,range 0-59
/// @param seconds seconds,range 0-59
/// 
/// @return TuyaSmartSceneActionModel
+ (TuyaSmartSceneActionModel *)createDelayActionWithHours:(NSString *)hours minutes:(NSString *)minutes seconds:(NSString *)seconds;
 
/// Create a push notification action.
///
/// @return TuyaSmartSceneActionModel
+ (TuyaSmartSceneActionModel *)createSendNotificationAction;
 
/// Create a call notification action(internal use, not open).
///
/// @return TuyaSmartSceneActionModel
+ (TuyaSmartSceneActionModel *)createCallAction;
 
/// Create a send sms action(internal use, not open).
///
/// @return TuyaSmartSceneActionModel
+ (TuyaSmartSceneActionModel *)createSmsAction;
 
@end
 
NS_ASSUME_NONNULL_END