Add variable support to template rendering

This commit is contained in:
Paulus Schoutsen committed 2015-12-10 21:16:05 -08:00
1 parent 0dcc69d800
commit 7acef84aad
2 files changed
+39 -28

No files matched your search

+8
View File
@@ -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}))