SP-1441 rework.

This commit is contained in:
Faris Armoush
2025-04-23 16:58:50 +03:00
parent 177a4711fe
commit 2c684a9495
7 changed files with 192 additions and 64 deletions

View File

@ -74,11 +74,33 @@ class ACHelper {
child: _buildFunctionsList(
context: context,
acFunctions: acFunctions,
onFunctionSelected: (functionCode, operationName) =>
context.read<FunctionBloc>().add(SelectFunction(
device: device,
onFunctionSelected: (functionCode, operationName) {
context.read<FunctionBloc>().add(
SelectFunction(
functionCode: functionCode,
operationName: operationName,
)),
),
);
if (functionCode == 'temp_set' ||
functionCode == 'temp_current') {
context.read<FunctionBloc>().add(
AddFunction(
functionData: DeviceFunctionData(
entityId: device?.uuid ?? '',
functionCode: functionCode,
operationName: operationName,
value: functionCode == 'temp_set'
? 200
: -100,
condition: '==',
valueDescription: selectedFunctionData
.valueDescription,
),
),
);
}
},
),
),
// Value selector
@ -137,6 +159,7 @@ class ACHelper {
required BuildContext context,
required List<ACFunction> acFunctions,
required Function(String, String) onFunctionSelected,
required AllDevicesModel? device,
}) {
return ListView.separated(
shrinkWrap: false,