mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 15:17:35 +00:00
parent
a94e8f48e0
commit
52a3aa1ca5
@ -95,7 +95,10 @@ class CommandSensorData(object):
|
|||||||
_LOGGER.info('Running command: %s', self.command)
|
_LOGGER.info('Running command: %s', self.command)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return_value = subprocess.check_output(self.command, shell=True)
|
return_value = subprocess.check_output(self.command, shell=True,
|
||||||
|
timeout=15)
|
||||||
self.value = return_value.strip().decode('utf-8')
|
self.value = return_value.strip().decode('utf-8')
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
_LOGGER.error('Command failed: %s', self.command)
|
_LOGGER.error('Command failed: %s', self.command)
|
||||||
|
except subprocess.TimeoutExpired:
|
||||||
|
_LOGGER.error('Timeout for command: %s', self.command)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user