mirror of
https://github.com/home-assistant/core.git
synced 2025-12-26 22:18:40 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user