From 04cdbd68a15a37f25f8e7fe2b694db290607bc5a Mon Sep 17 00:00:00 2001 From: Alan Johnston Date: Sat, 21 Feb 2026 08:37:08 -0500 Subject: [PATCH] input return integer not string Change return type of subprocess result to int and update error handling. --- transmit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/transmit.py b/transmit.py index e390db0f..67d4c314 100644 --- a/transmit.py +++ b/transmit.py @@ -26,13 +26,13 @@ def input(pin): print(f"Command run was: {query}") print("Sucess!") print(f"Output of the command (stdout): {result}") - return result + return int(result) except subprocess.CalledProcessError as e: print(f"Command failed with return code: {e.returncode}") print(f"Command run was: {e.cmd}") print(f"Output of the command (stdout): {e.stdout}") print(f"Error output of the command (stderr): {e.stderr}") - return 0 + return -1 def setup(pin, config): if config == "in" or config == "out" or config == "up" or config == "down":