Fix command line sensors removing quotes with template (#35559)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
1 parent
e13f206a06
commit
c65e72886c
2 files changed
+18
-2
No files matched your search
@@ -3,7 +3,6 @@ from collections.abc import Mapping
|
||||
from datetime import timedelta
|
||||
import json
|
||||
import logging
|
||||
import shlex
|
||||
import subprocess
|
||||
|
||||
import voluptuous as vol
|
||||
@@ -171,7 +170,7 @@ class CommandSensorData:
|
||||
pass
|
||||
else:
|
||||
# Template used. Construct the string used in the shell
|
||||
command = str(" ".join([prog] + shlex.split(rendered_args)))
|
||||
command = f"{prog} {rendered_args}"
|
||||
try:
|
||||
_LOGGER.debug("Running command: %s", command)
|
||||
return_value = subprocess.check_output(
|
||||
|
||||
Reference in new issue
Block a user