mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
Added current temp to AC functions
This commit is contained in:
@ -244,6 +244,7 @@ SOS
|
|||||||
SwitchFunction(deviceId: uuid ?? '', deviceName: name ?? ''),
|
SwitchFunction(deviceId: uuid ?? '', deviceName: name ?? ''),
|
||||||
ModeFunction(deviceId: uuid ?? '', deviceName: name ?? ''),
|
ModeFunction(deviceId: uuid ?? '', deviceName: name ?? ''),
|
||||||
TempSetFunction(deviceId: uuid ?? '', deviceName: name ?? ''),
|
TempSetFunction(deviceId: uuid ?? '', deviceName: name ?? ''),
|
||||||
|
CurrentTempFunction(deviceId: uuid ?? '', deviceName: name ?? ''),
|
||||||
LevelFunction(deviceId: uuid ?? '', deviceName: name ?? ''),
|
LevelFunction(deviceId: uuid ?? '', deviceName: name ?? ''),
|
||||||
ChildLockFunction(deviceId: uuid ?? '', deviceName: name ?? ''),
|
ChildLockFunction(deviceId: uuid ?? '', deviceName: name ?? ''),
|
||||||
];
|
];
|
||||||
|
@ -41,6 +41,11 @@ class DeviceDialogHelper {
|
|||||||
final deviceSelectedFunctions =
|
final deviceSelectedFunctions =
|
||||||
routineBloc.state.selectedFunctions[data['uniqueCustomId']] ?? [];
|
routineBloc.state.selectedFunctions[data['uniqueCustomId']] ?? [];
|
||||||
|
|
||||||
|
if (removeComparetors) {
|
||||||
|
//remove the current temp function in the 'if container'
|
||||||
|
functions.removeAt(3);
|
||||||
|
}
|
||||||
|
|
||||||
switch (productType) {
|
switch (productType) {
|
||||||
case 'AC':
|
case 'AC':
|
||||||
return ACHelper.showACFunctionsDialog(context, functions, data['device'],
|
return ACHelper.showACFunctionsDialog(context, functions, data['device'],
|
||||||
|
@ -151,3 +151,32 @@ class ChildLockFunction extends ACFunction {
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class CurrentTempFunction extends ACFunction {
|
||||||
|
final int min;
|
||||||
|
final int max;
|
||||||
|
final int step;
|
||||||
|
|
||||||
|
CurrentTempFunction({required super.deviceId, required super.deviceName})
|
||||||
|
: min = -100,
|
||||||
|
max = 990,
|
||||||
|
step = 1,
|
||||||
|
super(
|
||||||
|
code: 'temp_current',
|
||||||
|
operationName: 'Current Temperature',
|
||||||
|
icon: Assets.currentTemp,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<ACOperationalValue> getOperationalValues() {
|
||||||
|
List<ACOperationalValue> values = [];
|
||||||
|
for (int temp = min; temp <= max; temp += step) {
|
||||||
|
values.add(ACOperationalValue(
|
||||||
|
icon: Assets.currentTemp,
|
||||||
|
description: "${temp / 10}°C",
|
||||||
|
value: temp,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
return values;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -329,8 +329,8 @@ class ACHelper {
|
|||||||
) {
|
) {
|
||||||
return Slider(
|
return Slider(
|
||||||
value: initialValue is int ? initialValue.toDouble() : 200.0,
|
value: initialValue is int ? initialValue.toDouble() : 200.0,
|
||||||
min: 200,
|
min: selectCode == 'temp_current' ? -100 : 200,
|
||||||
max: 300,
|
max: selectCode == 'temp_current' ? 900 : 300,
|
||||||
divisions: 10,
|
divisions: 10,
|
||||||
label: '${((initialValue ?? 160) / 10).toInt()}°C',
|
label: '${((initialValue ?? 160) / 10).toInt()}°C',
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
|
Reference in New Issue
Block a user