mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 15:17:31 +00:00
Added current temp to AC functions
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user