Pre-compile templates (#3515)
* Pre-compile templates * Compile templates in numeric_state condition
This commit is contained in:
parent
b3d67a7ed9
commit
0c0feda834
15 changed files with 134 additions and 80 deletions
|
@ -46,6 +46,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
sensor_class = config.get(CONF_SENSOR_CLASS)
|
||||
value_template = config.get(CONF_VALUE_TEMPLATE)
|
||||
|
||||
if value_template is not None:
|
||||
value_template = template.compile_template(hass, value_template)
|
||||
|
||||
data = CommandSensorData(command)
|
||||
|
||||
add_devices([CommandBinarySensor(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue