added catch for no roku ip
This commit is contained in:
+1
-1
@@ -21,7 +21,7 @@ services:
|
||||
context: ./tools
|
||||
dockerfile: Dockerfile
|
||||
env_file: .env
|
||||
restart: unless-stopped
|
||||
restart: on-failure
|
||||
|
||||
networks:
|
||||
- internal
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user