Fix command line cover template (#3754)

The command line cover value template is optional so we
need to check it's not none before assigning hass to it.

Fixes #3649

Signed-off-by: Roi Dayan <roi.dayan@gmail.com>
This commit is contained in:
Roi Dayan 2016-10-08 23:03:32 +03:00 committed by Paulus Schoutsen
parent 7882b19dc5
commit 6419d273ea

View file

@ -38,7 +38,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
for device_name, device_config in devices.items():
value_template = device_config.get(CONF_VALUE_TEMPLATE)
value_template.hass = hass
if value_template is not None:
value_template.hass = hass
covers.append(
CommandCover(