mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +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()
|
self.data.update()
|
||||||
value = self.data.value
|
value = self.data.value
|
||||||
|
|
||||||
|
if self._value_template is not None:
|
||||||
self._state = template.render_with_possible_json_value(
|
self._state = template.render_with_possible_json_value(
|
||||||
self._hass, self._value_template, value, 'N/A')
|
self._hass, self._value_template, value, 'N/A')
|
||||||
|
else:
|
||||||
|
self._state = value
|
||||||
|
|
||||||
|
|
||||||
# pylint: disable=too-few-public-methods
|
# pylint: disable=too-few-public-methods
|
||||||
|
Loading…
x
Reference in New Issue
Block a user