From 3df3f3bc5bcc29d0cb08cefc8bd2f02cfe0dbc1e Mon Sep 17 00:00:00 2001 From: Kavish Devar Date: Fri, 27 Sep 2024 03:03:31 +0530 Subject: [PATCH] added disconnected state in battery state in standalone --- standalone.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/standalone.py b/standalone.py index b329da3..dd84207 100644 --- a/standalone.py +++ b/standalone.py @@ -83,7 +83,14 @@ class initL2CAP(): # Interpret the status def interpret_status(status): - return "Charging" if status == 1 else "Not Charging" + if status == 1: + return "Charging" + elif status == 2: + return "Not charging" + elif status == 4: + return "Disconnected" + else: + return "Unknown" # Print the results print(f"Left Bud: {self.left_bud_level}% - {interpret_status(self.left_bud_status)}")