Rename input_slider to input_number and add numeric text box option (#9494)

* * Rename input_slider to input_number
* Update input_number to optionally display slider, input box, or both

* input_number support either input box or slider mode, but not both

* input_number : change service from select_value to set_value

* input_number : add test for mode setting to tests
This commit is contained in:
BioSehnsucht authored and Pascal Vizeli committed 2017-10-03 21:34:13 +02:00
1 parent 29e973d060
commit 3c0d02f057
6 files changed
+101 -58

No files matched your search

+6 -6
View File
@@ -409,8 +409,8 @@ class TestTemplateCover(unittest.TestCase):
def test_set_position(self):
"""Test the set_position command."""
with assert_setup_component(1, 'cover'):
assert setup.setup_component(self.hass, 'input_slider', {
'input_slider': {
assert setup.setup_component(self.hass, 'input_number', {
'input_number': {
'test': {
'min': '0',
'max': '100',
@@ -424,10 +424,10 @@ class TestTemplateCover(unittest.TestCase):
'covers': {
'test_template_cover': {
'position_template':
"{{ states.input_slider.test.state | int }}",
"{{ states.input_number.test.state | int }}",
'set_cover_position': {
'service': 'input_slider.select_value',
'entity_id': 'input_slider.test',
'service': 'input_number.set_value',
'entity_id': 'input_number.test',
'data_template': {
'value': '{{ position }}'
},
@@ -440,7 +440,7 @@ class TestTemplateCover(unittest.TestCase):
self.hass.start()
self.hass.block_till_done()
state = self.hass.states.set('input_slider.test', 42)
state = self.hass.states.set('input_number.test', 42)
self.hass.block_till_done()
state = self.hass.states.get('cover.test_template_cover')
assert state.state == STATE_OPEN