mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-11-27 00:44:55 +00:00
push automation details and update automation
This commit is contained in:
@ -37,9 +37,9 @@ class CreateAutomationModel {
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
Map<String, dynamic> toMap([String? automationId]) {
|
||||
return {
|
||||
'unitUuid': unitUuid,
|
||||
if (automationId == null) 'unitUuid': unitUuid,
|
||||
'automationName': automationName,
|
||||
'decisionExpr': decisionExpr,
|
||||
'effectiveTime': effectiveTime.toMap(),
|
||||
@ -61,7 +61,7 @@ class CreateAutomationModel {
|
||||
);
|
||||
}
|
||||
|
||||
String toJson() => json.encode(toMap());
|
||||
String toJson([String? automationId]) => json.encode(toMap(automationId));
|
||||
|
||||
factory CreateAutomationModel.fromJson(String source) =>
|
||||
CreateAutomationModel.fromMap(json.decode(source));
|
||||
|
||||
Reference in New Issue
Block a user