mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-16 01:56:19 +00:00
push put api
This commit is contained in:
@ -47,9 +47,9 @@ class CreateSceneModel {
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
Map<String, dynamic> toMap([String? sceneId]) {
|
||||
return {
|
||||
'unitUuid': unitUuid,
|
||||
if (sceneId != null) 'unitUuid': unitUuid,
|
||||
'sceneName': sceneName,
|
||||
'decisionExpr': decisionExpr,
|
||||
'actions': actions.map((x) => x.toMap()).toList(),
|
||||
@ -66,7 +66,7 @@ class CreateSceneModel {
|
||||
);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
String toJson([String? sceneId]) => json.encode(toMap(sceneId));
|
||||
|
||||
factory CreateSceneModel.fromJson(String source) =>
|
||||
CreateSceneModel.fromMap(json.decode(source));
|
||||
|
Reference in New Issue
Block a user