From 2f14d74fbd4cb1f304e2657f115cf9869533bf77 Mon Sep 17 00:00:00 2001 From: Ryder-C Date: Tue, 3 Feb 2026 18:25:17 -0800 Subject: [PATCH] fix(linux-rust): Clear stale tray battery on device switch --- linux-rust/src/devices/airpods.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/linux-rust/src/devices/airpods.rs b/linux-rust/src/devices/airpods.rs index bbec2d425..e60ea6e07 100644 --- a/linux-rust/src/devices/airpods.rs +++ b/linux-rust/src/devices/airpods.rs @@ -34,7 +34,17 @@ impl AirPodsDevice { if let Some(handle) = &tray_handle { handle - .update(|tray: &mut MyTray| tray.connected = true) + .update(|tray: &mut MyTray| { + tray.connected = true; + tray.battery_headphone = None; + tray.battery_headphone_status = None; + tray.battery_l = None; + tray.battery_l_status = None; + tray.battery_r = None; + tray.battery_r_status = None; + tray.battery_c = None; + tray.battery_c_status = None; + }) .await; }