fix: report group control failures
This commit is contained in:
@@ -38,6 +38,17 @@ class _GroupCardState extends ConsumerState<GroupCard> {
|
||||
final int gVal = g['last_state']?['g'] ?? 200;
|
||||
final int b = g['last_state']?['b'] ?? 100;
|
||||
|
||||
ref.listen<GroupControlError?>(groupControlErrorProvider, (previous, next) {
|
||||
if (next == null || next.groupId != id) return;
|
||||
if (previous?.sequence == next.sequence) return;
|
||||
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text('Не удалось применить ${next.action}: ${next.message}'),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
// Значения слайдеров: локальные (если тянем) или серверные
|
||||
final briValue = (_localBrightness ?? bri.toDouble()).clamp(10.0, 100.0);
|
||||
final tempValue = (_localTemp ?? temp.toDouble()).clamp(2700.0, 6500.0);
|
||||
|
||||
Reference in New Issue
Block a user