Refactor water heater value selector widget

This commit is contained in:
mohammad
2025-05-14 09:16:04 +03:00
parent 36c5712c79
commit 996a847a27

View File

@ -28,7 +28,11 @@ class WaterHeaterValueSelectorWidget extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final selectedFn = whFunctions.firstWhere( final selectedFn = whFunctions.firstWhere(
(f) => f.code == selectedFunction, (f) => f.code == selectedFunction,
orElse: () => throw Exception('Function $selectedFunction not found'), orElse: () => WHSwitchFunction(
deviceId: '',
deviceName: '',
type: '',
),
); );
if (selectedFunction == 'countdown_1') { if (selectedFunction == 'countdown_1') {
return Column( return Column(