Fix command output handling to return an empty string on error
This commit is contained in:
parent
8a6fb77de3
commit
1f5da172d6
1 changed files with 1 additions and 1 deletions
|
@ -351,6 +351,6 @@ class HassUserClient(HassClient):
|
||||||
def run_command(cmd: list[str]) -> Tuple[int, str]:
|
def run_command(cmd: list[str]) -> Tuple[int, str]:
|
||||||
proc = run(cmd, capture_output=True)
|
proc = run(cmd, capture_output=True)
|
||||||
if proc.returncode != 0:
|
if proc.returncode != 0:
|
||||||
return proc.returncode, "null"
|
return proc.returncode, ""
|
||||||
|
|
||||||
return proc.returncode, proc.stdout.decode("utf-8")
|
return proc.returncode, proc.stdout.decode("utf-8")
|
||||||
|
|
Loading…
Add table
Reference in a new issue