Added possibilities to use template in the command_line sensor (#8505)

* Added possibilities to use template in the command_line sensor

* Minor style guideline conforms

* Minor style guideline conforms

* Added new test for template rendering

* Minor style guideline conforms

* Minor style guideline conforms

* Fixed failing testcases

* Fix style violations

* fix code pretty
This commit is contained in:
Marcus Schmidt 2017-08-10 18:52:52 +02:00 committed by Pascal Vizeli
parent c0663bf722
commit d7e8616651
4 changed files with 59 additions and 12 deletions

View file

@ -54,7 +54,7 @@ class TestCommandSensorBinarySensor(unittest.TestCase):
def test_template(self):
"""Test setting the state with a template."""
data = command_line.CommandSensorData('echo 10')
data = command_line.CommandSensorData(self.hass, 'echo 10')
entity = command_line.CommandBinarySensor(
self.hass, data, 'test', None, '1.0', '0',
@ -64,7 +64,7 @@ class TestCommandSensorBinarySensor(unittest.TestCase):
def test_sensor_off(self):
"""Test setting the state with a template."""
data = command_line.CommandSensorData('echo 0')
data = command_line.CommandSensorData(self.hass, 'echo 0')
entity = command_line.CommandBinarySensor(
self.hass, data, 'test', None, '1', '0', None)