feat: revamp sensor add flow
This commit is contained in:
@@ -94,6 +94,21 @@ class _FloorPlanScreenState extends ConsumerState<FloorPlanScreen> {
|
||||
ref.listen(sensorsProvider, (_, next) {
|
||||
next.whenData((s) => _editorKey.currentState?.loadSensors(s));
|
||||
});
|
||||
ref.listen(sensorsChannelProvider, (_, next) {
|
||||
next.whenData((msg) {
|
||||
switch (msg['event'] as String?) {
|
||||
case 'sensor_announced':
|
||||
ref.invalidate(sensorsProvider);
|
||||
case 'sensor_enrollment_timeout':
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
const SnackBar(
|
||||
content: Text('Sensor did not come online in time. '
|
||||
'Check WiFi credentials and try again.'),
|
||||
),
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
ref.listen(tagPositionsProvider, (_, next) {
|
||||
next.whenData((t) => _editorKey.currentState?.updateTags(t));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user