From 3ccc6d6ded23d7ea0532fdbd219525e126e4d5fe Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Thu, 16 Jul 2026 10:03:55 -0400 Subject: [PATCH] Update transmit.py fix os_status for trixie --- transmit.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/transmit.py b/transmit.py index 3ad82534..c39ee0a0 100644 --- a/transmit.py +++ b/transmit.py @@ -909,10 +909,24 @@ if __name__ == "__main__": # print(f"Error output of the command (stderr): {e.stderr}") if os_status == "VERSION_CODENAME=bookworm": os_status = "bookworm" - elif os_status == "VERSION_CODENAME=trixie": - os_status = "trixie" else: - os_status = "bullseye" + query = ["grep", "VERSION_CODENAME=trixie", "/etc/os-release"] + try: + result = subprocess.run(query, capture_output=True, text=True, check=True) + print(f"Command run was: {query}") + os_status = result.stdout.strip() + print(f"Output of the command (stdout): {os_status}") + except subprocess.CalledProcessError as e: + # print(f"Command failed with return code: {e.returncode}") + print(f"Command run was: {e.cmd}") + os_status = e.stdout.strip() + print(f"Output of the command (stdout): {e.stdout}") + # print(f"Error output of the command (stderr): {e.stderr}") + + if os_status == "VERSION_CODENAME=trixie": + os_status = "trixie" + else: + os_status = "bullseye" print (os_status) card = "Headphones" # default using pcm audio output of Pi Zero