Fix command line sensors removing quotes with template (#35559)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Xiaonan Shen 2020-06-10 09:31:59 -07:00 committed by GitHub
parent e13f206a06
commit c65e72886c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View file

@ -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(