mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-09 22:57:21 +00:00
- Refactor the WpsFunctions class in wps_functions.dart to use 'cm' instead of 'temp' for the description of operational values.
- Update the WallPresenceSensor class in wall_presence_sensor.dart to use the selected operation name
This commit is contained in:
@ -244,11 +244,12 @@ class CurrentDistanceFunction extends WpsFunctions {
|
||||
@override
|
||||
List<WpsOperationalValue> getOperationalValues() {
|
||||
List<WpsOperationalValue> values = [];
|
||||
for (int temp = min; temp <= max; temp += step) {
|
||||
for (int cm = min; cm <= max; cm += step) {
|
||||
values.add(WpsOperationalValue(
|
||||
icon: Assets.assetsTempreture,
|
||||
description: "${temp}CM",
|
||||
value: temp,
|
||||
description: "${cm}CM",
|
||||
|
||||
value: cm,
|
||||
));
|
||||
}
|
||||
return values;
|
||||
|
@ -13,7 +13,6 @@ import 'package:syncrow_web/utils/extension/build_context_x.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:syncrow_web/pages/routines/bloc/functions_bloc/functions_bloc_bloc.dart';
|
||||
|
||||
|
||||
class WallPresenceSensor extends StatefulWidget {
|
||||
final List<DeviceFunction> functions;
|
||||
final AllDevicesModel? device;
|
||||
@ -171,7 +170,7 @@ class _WallPresenceSensorState extends State<WallPresenceSensor> {
|
||||
orElse: () => DeviceFunctionData(
|
||||
entityId: '',
|
||||
functionCode: selectedFunction,
|
||||
operationName: '',
|
||||
operationName: state.selectedOperationName!,
|
||||
value: null,
|
||||
),
|
||||
);
|
||||
@ -251,11 +250,8 @@ class _ValueSelector extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
bool _isSliderFunction(String function) => [
|
||||
'dis_current',
|
||||
'presence_time',
|
||||
'illuminance_value'
|
||||
].contains(function);
|
||||
bool _isSliderFunction(String function) =>
|
||||
['dis_current', 'presence_time', 'illuminance_value'].contains(function);
|
||||
}
|
||||
|
||||
class _SliderValueSelector extends StatelessWidget {
|
||||
|
Reference in New Issue
Block a user