From c0d915666b3c3c71a65bbbd076c797694d44e5da Mon Sep 17 00:00:00 2001 From: Tim Gromeyer Date: Mon, 9 Jun 2025 10:53:10 +0200 Subject: [PATCH] [Linux] Remember battery state (closes #149) --- linux/battery.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/linux/battery.hpp b/linux/battery.hpp index e0defca..99119e4 100644 --- a/linux/battery.hpp +++ b/linux/battery.hpp @@ -99,7 +99,10 @@ public: auto level = static_cast(packet[offset + 2]); auto status = static_cast(packet[offset + 3]); - newStates[comp] = {level, status}; + if (status != BatteryStatus::Disconnected) + { + newStates[comp] = {level, status}; + } // If this is a pod (Left or Right), add it to the list if (comp == Component::Left || comp == Component::Right)