added catch for no roku ip

This commit is contained in:
ION606
2025-09-12 10:01:18 -04:00
parent 2947c8ac82
commit 9153c3b1c6
2 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ services:
context: ./tools
dockerfile: Dockerfile
env_file: .env
restart: unless-stopped
restart: on-failure
networks:
- internal
+4 -1
View File
@@ -5,7 +5,7 @@ import threading
ROKU_IP = os.environ.get("ROKU_IP")
if not ROKU_IP:
raise Exception("Roku IP not found in env!")
print("Roku IP not found in env!")
COMMANDS = {
# Standard Keys
@@ -69,6 +69,9 @@ class RokuWrapper():
return self._send_msg(500, {"error": "roku connection failed"})
def run_command(self, command: str):
if not ROKU_IP:
return self._send_msg(500, {"error": "Roku IP not found in env! Do not attempt further Roku requests"})
if not command:
return self._send_msg(404, {"error": "command not given"})
command = command.split('/')[0]