From decf070f9f512f5369ef30083915462a702671b5 Mon Sep 17 00:00:00 2001 From: Ryder Date: Mon, 9 Feb 2026 19:19:03 -0800 Subject: [PATCH] fix(linux-rust): Clear stale tray battery on device switch (#447) --- 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 bbec2d4..e60ea6e 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; }