Skip to content

Commit c0d9156

Browse files
committed
[Linux] Remember battery state (closes #149)
1 parent 91ffaaa commit c0d9156

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

linux/battery.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,10 @@ class Battery : public QObject
9999
auto level = static_cast<quint8>(packet[offset + 2]);
100100
auto status = static_cast<BatteryStatus>(packet[offset + 3]);
101101

102-
newStates[comp] = {level, status};
102+
if (status != BatteryStatus::Disconnected)
103+
{
104+
newStates[comp] = {level, status};
105+
}
103106

104107
// If this is a pod (Left or Right), add it to the list
105108
if (comp == Component::Left || comp == Component::Right)

0 commit comments

Comments
 (0)