mirror of
https://github.com/SyncrowIOT/syncrow-app.git
synced 2025-07-15 17:47:28 +00:00
push door lock automation functions
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:syncrow_app/features/scene/enum/operation_dialog_type.dart';
|
||||
import 'package:uuid/uuid.dart';
|
||||
|
||||
class SceneStaticFunction {
|
||||
@ -13,6 +14,7 @@ class SceneStaticFunction {
|
||||
final String uniqueCustomId;
|
||||
final dynamic functionValue;
|
||||
final String? deviceIcon;
|
||||
final OperationDialogType operationDialogType;
|
||||
|
||||
SceneStaticFunction({
|
||||
required this.icon,
|
||||
@ -23,6 +25,7 @@ class SceneStaticFunction {
|
||||
required this.operationName,
|
||||
required this.functionValue,
|
||||
this.deviceIcon,
|
||||
required this.operationDialogType,
|
||||
}) : uniqueCustomId = const Uuid().v4();
|
||||
|
||||
SceneStaticFunction copyWith({
|
||||
@ -35,6 +38,7 @@ class SceneStaticFunction {
|
||||
dynamic functionValue,
|
||||
String? deviceIcon,
|
||||
String? deviceName,
|
||||
OperationDialogType? operationDialogType,
|
||||
}) {
|
||||
return SceneStaticFunction(
|
||||
icon: icon ?? this.icon,
|
||||
@ -45,6 +49,7 @@ class SceneStaticFunction {
|
||||
operationName: operationName ?? this.operationName,
|
||||
functionValue: functionValue ?? this.functionValue,
|
||||
deviceIcon: deviceIcon ?? this.deviceIcon,
|
||||
operationDialogType: operationDialogType ?? this.operationDialogType,
|
||||
);
|
||||
}
|
||||
|
||||
@ -57,8 +62,8 @@ class SceneStaticFunction {
|
||||
'deviceId': deviceId,
|
||||
'operationName': operationName,
|
||||
'functionValue': functionValue,
|
||||
'deviceIcon': deviceIcon
|
||||
|
||||
'deviceIcon': deviceIcon,
|
||||
'operationDialogType': operationDialogType.name
|
||||
};
|
||||
}
|
||||
|
||||
@ -74,6 +79,9 @@ class SceneStaticFunction {
|
||||
operationName: map['operationName'] ?? '',
|
||||
functionValue: map['functionValue'] ?? '',
|
||||
deviceIcon: map['deviceIcon'] ?? '',
|
||||
operationDialogType: map['operationDialogType'] != null
|
||||
? OperationDialogType.values.byName(map['operationDialogType'])
|
||||
: OperationDialogType.none,
|
||||
);
|
||||
}
|
||||
|
||||
@ -84,7 +92,7 @@ class SceneStaticFunction {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SceneStaticFunction(icon: $icon, name: $deviceName, code: $code, operationalValues: $operationalValues, deviceId: $deviceId, operationName: $operationName, functionValue: $functionValue, deviceIcon: $deviceIcon)';
|
||||
return 'SceneStaticFunction(icon: $icon, name: $deviceName, code: $code, operationalValues: $operationalValues, deviceId: $deviceId, operationName: $operationName, functionValue: $functionValue, deviceIcon: $deviceIcon, operationDialogType: $operationDialogType)';
|
||||
}
|
||||
|
||||
@override
|
||||
@ -98,6 +106,7 @@ class SceneStaticFunction {
|
||||
other.operationName == operationName &&
|
||||
other.functionValue == functionValue &&
|
||||
other.deviceIcon == deviceIcon &&
|
||||
other.operationDialogType == operationDialogType &&
|
||||
listEquals(other.operationalValues, operationalValues) &&
|
||||
other.deviceId == deviceId;
|
||||
}
|
||||
@ -111,6 +120,7 @@ class SceneStaticFunction {
|
||||
operationName.hashCode ^
|
||||
functionValue.hashCode ^
|
||||
deviceIcon.hashCode ^
|
||||
operationDialogType.hashCode ^
|
||||
operationalValues.hashCode;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user