PM updates, still need Battery to show up on periph screen and calibration/recalib stuff to work, but it should tomorrow

This commit is contained in:
2026-03-18 01:51:55 -05:00
parent ea0326394f
commit 80a2884077
8 changed files with 197 additions and 35 deletions

View File

@@ -145,6 +145,35 @@ class _PeripheralScreenState extends State<PeripheralScreen> {
));
});
// Server emits this when the device reports its own calibration state.
// When calibrated=false, reset all calibration UI state so the
// pre-calibration screen is shown and the user can tap Calibrate.
socket?.on("calib_status_changed", (data) {
if (data is Map<String, dynamic>) {
if (data['periphID'] == widget.peripheralId) {
if (!mounted) return;
if (data['calibrated'] == false) {
setState(() {
calibrated = false;
calibrating = false;
calibrationStage = 0;
});
}
}
}
});
socket?.on("device_pos_report", (data) {
if (data is Map<String, dynamic>) {
if (data['periphID'] == widget.peripheralId) {
if (!mounted) return;
setState(() {
_blindPosition = (data['pos'] as int).toDouble();
});
}
}
});
socket?.on("calib", (periphData) {
if (periphData is Map<String, dynamic>) {
if (periphData['periphID'] == widget.peripheralId) {