add water heater device to routine and fix device type in routine

This commit is contained in:
mohammad
2025-05-05 10:00:54 +03:00
parent 5890a70243
commit 8a21828dd4
13 changed files with 352 additions and 22 deletions

View File

@ -16,6 +16,7 @@ class SceneStaticFunction {
final String? deviceIcon;
final OperationDialogType operationDialogType;
final String? comparator;
final String? deviceType;
SceneStaticFunction({
required this.icon,
@ -28,6 +29,7 @@ class SceneStaticFunction {
this.deviceIcon,
required this.operationDialogType,
this.comparator,
this.deviceType,
String? uniqueCustomId,
}) : uniqueCustomId = uniqueCustomId ?? const Uuid().v4();
@ -44,6 +46,7 @@ class SceneStaticFunction {
OperationDialogType? operationDialogType,
String? comparator,
String? uniqueCustomId,
String? deviceType,
}) {
return SceneStaticFunction(
icon: icon ?? this.icon,
@ -57,6 +60,7 @@ class SceneStaticFunction {
operationDialogType: operationDialogType ?? this.operationDialogType,
comparator: comparator ?? this.comparator,
uniqueCustomId: uniqueCustomId ?? const Uuid().v4(),
deviceType: deviceType ?? this.deviceType,
);
}
@ -73,6 +77,7 @@ class SceneStaticFunction {
'operationDialogType': operationDialogType.name,
'comparator': comparator,
'uniqueCustomId': uniqueCustomId,
'deviceType': deviceType,
};
}
@ -93,6 +98,7 @@ class SceneStaticFunction {
: OperationDialogType.none,
comparator: map['comparator'],
uniqueCustomId: map['uniqueCustomId'] ?? const Uuid().v4(),
deviceType: map['deviceType'] ?? '',
);
}
@ -103,7 +109,7 @@ class SceneStaticFunction {
@override
String toString() {
return 'SceneStaticFunction(icon: $icon, name: $deviceName, code: $code, operationalValues: $operationalValues, deviceId: $deviceId, operationName: $operationName, functionValue: $functionValue, deviceIcon: $deviceIcon, operationDialogType: $operationDialogType, comparator: $comparator, uniqueCustomId: $uniqueCustomId)';
return 'SceneStaticFunction(icon: $icon, name: $deviceName, code: $code, operationalValues: $operationalValues, deviceId: $deviceId, operationName: $operationName, functionValue: $functionValue, deviceIcon: $deviceIcon, operationDialogType: $operationDialogType, comparator: $comparator, uniqueCustomId: $uniqueCustomId, deviceType: $deviceType)';
}
@override
@ -121,7 +127,7 @@ class SceneStaticFunction {
other.uniqueCustomId == uniqueCustomId &&
other.operationDialogType == operationDialogType &&
listEquals(other.operationalValues, operationalValues) &&
other.deviceId == deviceId;
other.deviceId == deviceId && other.deviceType == deviceType;
}
@override
@ -136,7 +142,7 @@ class SceneStaticFunction {
comparator.hashCode ^
uniqueCustomId.hashCode ^
operationDialogType.hashCode ^
operationalValues.hashCode;
operationalValues.hashCode ^ deviceType.hashCode;
}
}