Customizable command timeout (#15442)

* Customizable command timeout

* Change string to int

* update the tests. Do the same thing on the binary_sensor.command_line.
This commit is contained in:
lich 2018-07-18 04:58:30 +08:00 committed by Fabian Affolter
parent 4ab502a691
commit 7d7c2104ea
4 changed files with 27 additions and 11 deletions

View file

@ -24,7 +24,9 @@ class TestCommandSensorBinarySensor(unittest.TestCase):
config = {'name': 'Test',
'command': 'echo 1',
'payload_on': '1',
'payload_off': '0'}
'payload_off': '0',
'command_timeout': 15
}
devices = []
@ -43,7 +45,7 @@ class TestCommandSensorBinarySensor(unittest.TestCase):
def test_template(self):
"""Test setting the state with a template."""
data = command_line.CommandSensorData(self.hass, 'echo 10')
data = command_line.CommandSensorData(self.hass, 'echo 10', 15)
entity = command_line.CommandBinarySensor(
self.hass, data, 'test', None, '1.0', '0',
@ -53,7 +55,7 @@ class TestCommandSensorBinarySensor(unittest.TestCase):
def test_sensor_off(self):
"""Test setting the state with a template."""
data = command_line.CommandSensorData(self.hass, 'echo 0')
data = command_line.CommandSensorData(self.hass, 'echo 0', 15)
entity = command_line.CommandBinarySensor(
self.hass, data, 'test', None, '1', '0', None)