Add variable support to template rendering
This commit is contained in:
1 parent
0dcc69d800
commit
7acef84aad
2 files changed
+39
-28
No files matched your search
@@ -64,3 +64,11 @@ class TestUtilTemplate(unittest.TestCase):
|
||||
template.render(
|
||||
self.hass,
|
||||
'{{ states.sensor.temperature.state | multiply(10) | round }}'))
|
||||
|
||||
def test_passing_vars_as_keywords(self):
|
||||
self.assertEqual(
|
||||
'127', template.render(self.hass, '{{ hello }}', hello=127))
|
||||
|
||||
def test_passing_vars_as_vars(self):
|
||||
self.assertEqual(
|
||||
'127', template.render(self.hass, '{{ hello }}', {'hello': 127}))
|
||||
Reference in new issue
Block a user