mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Ignore template if it isn't set
This commit is contained in:
parent
600831cff5
commit
e821b546d5
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user