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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
//
//  TuyaSmartSceneActionModel.h
//  TuyaSmartSceneKit
//
//  Copyright (c) 2014-2021 Tuya Inc. (https://developer.tuya.com)
 
/// push message action
static NSString * const ACTION_EXECUTOR_APP_PUSH = @"appPushTrigger";
/// call action
static NSString * const ACTION_EXECUTOR_APP_CALL = @"mobileVoiceSend";
/// sms action
static NSString * const ACTION_EXECUTOR_SMS_SEND = @"smsSend";
/// device dp action
static NSString * const ACTION_EXECUTOR_DP_ISSUE = @"dpIssue";
/// device group dp action
static NSString * const ACTION_EXECUTOR_GROUP_DP_ISSUE = @"deviceGroupDpIssue";
/// ir device dp action
static NSString * const ACTION_EXECUTOR_IR_ISSUE = @"irIssue";
/// ir device dp action(2rd version)
static NSString * const ACTION_EXECUTOR_IR_ISSUE_VII = @"irIssueVii";
/// enable a automation
static NSString * const ACTION_EXECUTOR_RULE_ENABLE = @"ruleEnable";
/// diable a automation
static NSString * const ACTION_EXECUTOR_RULE_DISABLE = @"ruleDisable";
/// execute a scene
static NSString * const ACTION_EXECUTOR_RULE_TRIGGER = @"ruleTrigger";
/// delay action
static NSString * const ACTION_EXECUTOR_DELAY = @"delay";
/// toggle action
static NSString * const ACTION_EXECUTOR_TOGGLE = @"toggle";
/// step action
extern NSString * const ACTION_EXECUTOR_STEP;
 
/// The five types of action status. Provides loading, success, offline, timeout and delay types.
typedef NS_ENUM(NSInteger, TYSceneActionStatus)
{
    /// The loading action type.
    TYSceneActionStatusLoading = 0,
    /// The success action type.
    TYSceneActionStatusSuccess,
    /// The offline action type.
    TYSceneActionStatusOffline,
    /// The timeout action type.
    TYSceneActionStatusTimeout,
    /// The delay action type.
    TYSceneActionStatusDelay,
};
 
 
/// @brief Data model for Scene Base Action.
@interface TuyaSmartSceneActionModel : NSObject<NSCoding>
 
/// The action id.
@property (nonatomic, copy) NSString *actionId;
 
/// The entity id. If action is a device, entityId is devId, and groupId for group action, @"delay" for a delay action, sceneId of operated scene for scene action.
@property (nonatomic, copy) NSString *entityId;
 
/// The entity name, like "lamp", "lamp group".
@property (nonatomic, copy) NSString *entityName;
 
/// The scene id, can be used to save the scene's Id which this action belonged to.
@property (nonatomic, copy) NSString *scenarioId;
 
/// Describe what this action will do, like "Switch : Open".
@property (nonatomic, copy) NSString *actionDisplay;
 
/// Describe what this action will do with origin format like the below example, you can use it to create the description.
/// {
///    1: [
///        "Switch",
///        "Open"
///        ]
/// }
@property (nonatomic, strong) NSDictionary *actionDisplayNew;
 
 
/// The action type, can be the followed types:
/// "dpIssue" :execute a device action.
/// "deviceGroupDpIssue": execute a group action.
/// "irIssue": execute an infrared device, like an air conditioner which is controlled by a remote control.
/// "irIssueVii": execute an infrared device, like an air conditioner which is controlled by a remote control.ExecutorProperty is real infrared ray remotes control code.
/// "ruleTrigger": execute a scene.
/// "ruleEnable":  Enable an automation.
/// "ruleDisable": Disable an automation.
/// "delay": Delay for a while.
@property (nonatomic, copy) NSString *actionExecutor;
 
 
/// Execute property, like {"1":true, ...}, "1" is dpId, a data point's Id, value is the value you want this datapoint to set. Delay action should be like "executorProperty":{"seconds":"5","minutes":"0"}.
@property (nonatomic, strong) NSDictionary *executorProperty;
 
/// Local property of scene , save gId and gwId.
@property (nonatomic, strong) NSDictionary *extraProperty;
 
/// If this action is a device type action and this device has been removed from the current account, this flag is YES.
@property (nonatomic, assign) BOOL devDelMark;
 
/// If this action is a device type action, and this device has been removed from the current account, then provide this icon url to display the device icon.
@property (nonatomic, copy) NSString *deleteDevIcon;
 
/// Execute action status, you can use this property to store the execute status when executing.
@property (nonatomic, assign) TYSceneActionStatus status;
 
#pragma mark - Panel info
 
/// The panel id, this value will be assigned by cloud server when this action should be oprate by a React Native panel.
@property (nonatomic, copy) NSString *uiid;
 
#pragma mark - Recommend info
 
/// The recommend product id.
@property (nonatomic, copy) NSString *productId;
 
/// The recommend product icon.
@property (nonatomic, copy) NSString *productPic;
 
/// The recommend product local default icon.
@property (nonatomic, copy) NSString *defaultIconUrl;
@end