Add multiply template filter
This commit is contained in:
parent
b440c260e6
commit
af09a305cf
2 changed files with 20 additions and 2 deletions
|
@ -55,3 +55,12 @@ class TestUtilTemplate(unittest.TestCase):
|
|||
template.render(
|
||||
self.hass,
|
||||
'{{ states.sensor.temperature.state | round(1) }}'))
|
||||
|
||||
def test_rounding_value2(self):
|
||||
self.hass.states.set('sensor.temperature', 12.34)
|
||||
|
||||
self.assertEqual(
|
||||
'123',
|
||||
template.render(
|
||||
self.hass,
|
||||
'{{ states.sensor.temperature.state | multiply(10) | round }}'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue