Ignore template if it isn't set

This commit is contained in:
Philip Lundrigan committed 2015-12-14 10:49:54 -07:00
1 parent 600831cff5
commit e821b546d5
1 file changed
+5 -2
@@ -73,8 +73,11 @@ class CommandSensor(Entity):
self.data.update()
value = self.data.value
self._state = template.render_with_possible_json_value(
self._hass, self._value_template, value, 'N/A')
if self._value_template is not None:
self._state = template.render_with_possible_json_value(
self._hass, self._value_template, value, 'N/A')
else:
self._state = value
# pylint: disable=too-few-public-methods