Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.command_line.utils Namespace Reference

Functions

int async_call_shell_with_timeout (str command, int timeout, *bool log_return_code=True)
 
str|None async_check_output_or_log (str command, int timeout)
 

Variables

int _EXEC_FAILED_CODE = 127
 
 _LOGGER = logging.getLogger(__name__)
 

Detailed Description

The command_line component utils.

Function Documentation

◆ async_call_shell_with_timeout()

int homeassistant.components.command_line.utils.async_call_shell_with_timeout ( str  command,
int  timeout,
*bool   log_return_code = True 
)
Run a shell command with a timeout.

If log_return_code is set to False, it will not print an error if a non-zero
return code is returned.

Definition at line 12 of file utils.py.

◆ async_check_output_or_log()

str | None homeassistant.components.command_line.utils.async_check_output_or_log ( str  command,
int  timeout 
)
Run a shell command with a timeout and return the output.

Definition at line 44 of file utils.py.

Variable Documentation

◆ _EXEC_FAILED_CODE

int homeassistant.components.command_line.utils._EXEC_FAILED_CODE = 127
private

Definition at line 9 of file utils.py.

◆ _LOGGER

homeassistant.components.command_line.utils._LOGGER = logging.getLogger(__name__)
private

Definition at line 8 of file utils.py.