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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
//
//  TuyaSmartSceneModel.h
//  TuyaSmartSceneKit
//
//  Copyright (c) 2014-2021 Tuya Inc. (https://developer.tuya.com)
 
#import <Foundation/Foundation.h>
 
#import "TuyaSmartSceneActionModel.h"
#import "TuyaSmartSceneConditionModel.h"
#import "TuyaSmartScenePreConditionModel.h"
 
 
/// The two types of condition match. Provides any and all types.
typedef enum : NSUInteger {
    /// The condition match any type, it means any one condition in the scene is be matched, it will be executed.
    TuyaSmartConditionMatchAny = 1,
    /// The condition match all type, it means all conditions in the scene is be matched, it will be executed.
    TuyaSmartConditionMatchAll
} TuyaSmartConditionMatchType;
 
/// The three types of recommend scene. Provides none, scene and automation types.
typedef enum : NSUInteger {
    /// The none recommend type, indicates it is neither tap-to-run nor automation scene.
    TuyaSmartSceneRecommendTypeNone,
    /// The tap-to-run recommend scene type.
    TuyaSmartSceneRecommendTypeScene,
    /// The automation recommend scene type.
    TuyaSmartSceneRecommendTypeAutomation
} TuyaSmartSceneRecommendType;
 
/// The three types of collection scene. Provides none, scene and automation types.
typedef enum : NSUInteger {
    /// The none collection type, indicates it is neither tap-to-run nor automation scene.
    TuyaSmartSceneCollectionTypeNone,
    /// The tap-to-run collection scene type.
    TuyaSmartSceneCollectionTypeScene,
    /// The automation collection scene type.
    TuyaSmartSceneCollectionTypeAutomation
} TuyaSmartSceneCollectionType;
 
/// The two types of device list on the panel when creating scene.
typedef NS_ENUM(NSInteger, TuyaSmartScenePanelType) {
    /// The non all device panel type, indicates you can only add zigbee device in the scene action.
    TuyaSmartScenePanelTypeNonAllDevevice = 0,
    /// The all device panel type, indicates you can add zigbee device and wifi device in the scene action.
    TuyaSmartScenePanelTypeAllDevices
};
 
/// @brief TuyaSmartSceneModel provides more data attributes for developers to implement business logic of the scene.
@interface TuyaSmartSceneModel : NSObject<NSCoding>
 
/// The scene id, it's unique. But only custom scene has this property.
@property (nonatomic, strong) NSString *sceneId;
 
/// The scene code, only default scene has this property.
@property (nonatomic, strong) NSString *code;
 
/// The scene name, it describes what the scene is used to.
@property (nonatomic, strong) NSString *name;
 
/// Whether the scene enabled, this status is used to automation scene and default enabled in tap-to-run scene.
@property (nonatomic, assign) BOOL enabled;
 
/// Whether show scene in first page, the status only can be switched when editing scene.
@property (nonatomic, assign) BOOL stickyOnTop;
 
/// The pre condition object model list is used to set the valid time period for automation scene. More information about TuyaSmartScenePreConditionModel, you can see TuyaSmartScenePreConditionModel class.
@property (nonatomic, strong) NSArray<TuyaSmartScenePreConditionModel *> *preConditions;
 
/// The condition model list,
@property (nonatomic, strong) NSArray<TuyaSmartSceneConditionModel *> *conditions;
 
/// The action model list,
@property (nonatomic, strong) NSArray<TuyaSmartSceneActionModel *> *actions;
 
/// The device list,
@property (nonatomic, strong) NSArray *devList;
 
/// The scene background icon URL
@property (nonatomic, copy) NSString *coverIcon;
 
/// The scene background color hex string.
@property (nonatomic, copy) NSString *displayColor;
 
/// The scene background URL, when created a new scene, use the URL provided by Tuya.
@property (nonatomic, strong) NSString *background;
 
/// The condition match type, For detail you can see TuyaSmartConditionMatchType enumeration value introduction.
@property (nonatomic, assign) TuyaSmartConditionMatchType matchType;
 
/// Whether this scene is bound to a panel. This attribute only supports standard zigbee devices.
@property (nonatomic, assign) BOOL boundForPanel;
 
/// Whether this scene is bound by a panel with new firmware. The new panel indicates that the scene supports zigbee devices and wifi devices.
@property (nonatomic, assign) BOOL boundForWiFiPanel;
 
/// Whether the automation scene supports to execute in LAN, If YES indicates the automation scene can be executed when zigbee gateway is offline.
@property (nonatomic, assign) BOOL localLinkage;
 
/// Whether the tap-to-run scene supports to execute in LAN, If YES indicates you can directly notify the zigbee gateway to execute the scene through TCP or MQTT messages.
@property (nonatomic, assign) BOOL newLocalScene;
 
/// The bound panel type, For detail you can see TuyaSmartScenePanelType enumeration value introduction.
@property (nonatomic, assign) TuyaSmartScenePanelType panelType;
 
/// The recommend scene type, For detail you can see TuyaSmartSceneRecommendType enumeration value introduction.
@property (nonatomic, assign) TuyaSmartSceneRecommendType recommendType;
 
/// The collection scene type, For detail you can see TuyaSmartSceneCollectionType enumeration value introduction.
@property (nonatomic, assign) TuyaSmartSceneCollectionType collectionType;
 
/// The recommend scene description.
@property (nonatomic, copy) NSString *recomDescription;
 
/// The recommended coefficient value of recommended scene, the range value is 0-100.
@property (nonatomic, assign) CGFloat recomCoefficient;
 
/// The timestamp when the automation scene will be automatically closed, The zero means it has not been set.
@property (nonatomic, assign) long long  disableTime;
 
#pragma mark - Business field
 
/// Whether the scene has already obtained details.
@property (nonatomic, assign) BOOL cached;
 
/// The arrow icon URL.
@property (nonatomic, copy) NSString *arrowIconUrl;
 
#pragma mark - Deprecated
 
/// The scene subtitle.
@property (nonatomic, strong) NSString *subTitle __deprecated;
 
/// The scene edit icon URL.
@property (nonatomic, strong) NSString *editIcon __deprecated;
 
/// The scene display icon URL.
@property (nonatomic, strong) NSString *displayIcon __deprecated;
 
@end