From 42f26bb1950f8ef51c00fb77e58c76771dd05994 Mon Sep 17 00:00:00 2001 From: Brian Cribbs Date: Tue, 30 May 2017 17:49:47 -0400 Subject: [PATCH 1/7] adding set position ability removing command_topic being required --- homeassistant/components/cover/mqtt.py | 49 +++++++- tests/components/cover/test_mqtt.py | 154 ++++++++++++++++++++++--- 2 files changed, 181 insertions(+), 22 deletions(-) diff --git a/homeassistant/components/cover/mqtt.py b/homeassistant/components/cover/mqtt.py index d44d011bcb13be..1b8c06774eff16 100644 --- a/homeassistant/components/cover/mqtt.py +++ b/homeassistant/components/cover/mqtt.py @@ -14,7 +14,8 @@ from homeassistant.components.cover import ( CoverDevice, ATTR_TILT_POSITION, SUPPORT_OPEN_TILT, SUPPORT_CLOSE_TILT, SUPPORT_STOP_TILT, SUPPORT_SET_TILT_POSITION, - SUPPORT_OPEN, SUPPORT_CLOSE, SUPPORT_STOP, SUPPORT_SET_POSITION) + SUPPORT_OPEN, SUPPORT_CLOSE, SUPPORT_STOP, SUPPORT_SET_POSITION, + ATTR_POSITION) from homeassistant.const import ( CONF_NAME, CONF_VALUE_TEMPLATE, CONF_OPTIMISTIC, STATE_OPEN, STATE_CLOSED, STATE_UNKNOWN) @@ -29,6 +30,8 @@ CONF_TILT_COMMAND_TOPIC = 'tilt_command_topic' CONF_TILT_STATUS_TOPIC = 'tilt_status_topic' +CONF_POSITION_TOPIC = 'set_position_topic' +CONF_SET_POSITION_TEMPLATE = 'set_position_template' CONF_PAYLOAD_OPEN = 'payload_open' CONF_PAYLOAD_CLOSE = 'payload_close' @@ -55,10 +58,17 @@ DEFAULT_TILT_OPTIMISTIC = False DEFAULT_TILT_INVERT_STATE = False +OPEN_CLOSE_FEATURES = (SUPPORT_OPEN | SUPPORT_CLOSE | SUPPORT_STOP) TILT_FEATURES = (SUPPORT_OPEN_TILT | SUPPORT_CLOSE_TILT | SUPPORT_STOP_TILT | SUPPORT_SET_TILT_POSITION) -PLATFORM_SCHEMA = mqtt.MQTT_RW_PLATFORM_SCHEMA.extend({ +PLATFORM_SCHEMA = mqtt.MQTT_BASE_PLATFORM_SCHEMA.extend({ + vol.Optional(CONF_COMMAND_TOPIC, default=None): valid_publish_topic, + vol.Optional(CONF_POSITION_TOPIC, default=None): valid_publish_topic, + vol.Optional(CONF_SET_POSITION_TEMPLATE, default=None): cv.template, + vol.Optional(CONF_RETAIN, default=DEFAULT_RETAIN): cv.boolean, + vol.Optional(CONF_STATE_TOPIC): valid_subscribe_topic, + vol.Optional(CONF_VALUE_TEMPLATE): cv.template, vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string, vol.Optional(CONF_PAYLOAD_OPEN, default=DEFAULT_PAYLOAD_OPEN): cv.string, vol.Optional(CONF_PAYLOAD_CLOSE, default=DEFAULT_PAYLOAD_CLOSE): cv.string, @@ -88,7 +98,7 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None): if value_template is not None: value_template.hass = hass - async_add_devices([MqttCover( + async_add_devices([MqttCover(hass, config.get(CONF_NAME), config.get(CONF_STATE_TOPIC), config.get(CONF_COMMAND_TOPIC), @@ -109,18 +119,20 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None): config.get(CONF_TILT_MAX), config.get(CONF_TILT_STATE_OPTIMISTIC), config.get(CONF_TILT_INVERT_STATE), + config.get(CONF_POSITION_TOPIC), + config.get(CONF_SET_POSITION_TEMPLATE), )]) class MqttCover(CoverDevice): """Representation of a cover that can be controlled using MQTT.""" - def __init__(self, name, state_topic, command_topic, tilt_command_topic, + def __init__(self, hass, name, state_topic, command_topic, tilt_command_topic, tilt_status_topic, qos, retain, state_open, state_closed, payload_open, payload_close, payload_stop, optimistic, value_template, tilt_open_position, tilt_closed_position, tilt_min, tilt_max, tilt_optimistic, - tilt_invert): + tilt_invert, position_topic, set_position_template): """Initialize the cover.""" self._position = None self._state = None @@ -145,6 +157,10 @@ def __init__(self, name, state_topic, command_topic, tilt_command_topic, self._tilt_max = tilt_max self._tilt_optimistic = tilt_optimistic self._tilt_invert = tilt_invert + self._position_topic = position_topic + self._set_position_template = set_position_template + if set_position_template is not None: + self._set_position_template.hass = hass @asyncio.coroutine def async_added_to_hass(self): @@ -233,7 +249,12 @@ def current_cover_tilt_position(self): @property def supported_features(self): """Flag supported features.""" - supported_features = SUPPORT_OPEN | SUPPORT_CLOSE | SUPPORT_STOP + supported_features = 0 + if self._command_topic is not None: + supported_features = OPEN_CLOSE_FEATURES + + if self._position_topic is not None: + supported_features |= SUPPORT_SET_POSITION if self.current_cover_position is not None: supported_features |= SUPPORT_SET_POSITION @@ -314,6 +335,22 @@ def async_set_cover_tilt_position(self, **kwargs): mqtt.async_publish(self.hass, self._tilt_command_topic, level, self._qos, self._retain) + + @asyncio.coroutine + def async_set_cover_position(self, **kwargs): + """Move the cover to a specific position.""" + if ATTR_POSITION in kwargs: + position = kwargs[ATTR_POSITION] + if self._set_position_template is not None: + try: + position = self._set_position_template.async_render() + except TemplateError as ex: + _LOGGER.error(ex) + self._state = None + + mqtt.async_publish(self.hass, self._position_topic, + position, self._qos, self._retain) + def find_percentage_in_range(self, position): """Find the 0-100% value within the specified range.""" diff --git a/tests/components/cover/test_mqtt.py b/tests/components/cover/test_mqtt.py index e685a51f56c868..7224177c5be21a 100644 --- a/tests/components/cover/test_mqtt.py +++ b/tests/components/cover/test_mqtt.py @@ -215,6 +215,8 @@ def test_current_cover_position(self): 'cover.test').attributes self.assertFalse('current_position' in state_attributes_dict) self.assertFalse('current_tilt_position' in state_attributes_dict) + self.assertFalse(4 & self.hass.states.get( + 'cover.test').attributes['supported_features'] == 4) fire_mqtt_message(self.hass, 'state-topic', '0') self.hass.block_till_done() @@ -240,6 +242,126 @@ def test_current_cover_position(self): 'cover.test').attributes['current_position'] self.assertEqual(50, current_cover_position) + def test_set_cover_position(self): + """Test setting cover position.""" + self.assertTrue(setup_component(self.hass, cover.DOMAIN, { + cover.DOMAIN: { + 'platform': 'mqtt', + 'name': 'test', + 'state_topic': 'state-topic', + 'command_topic': 'command-topic', + 'set_position_topic': 'position-topic', + 'payload_open': 'OPEN', + 'payload_close': 'CLOSE', + 'payload_stop': 'STOP' + } + })) + + state_attributes_dict = self.hass.states.get( + 'cover.test').attributes + self.assertFalse('current_position' in state_attributes_dict) + self.assertFalse('current_tilt_position' in state_attributes_dict) + + self.assertTrue(4 & self.hass.states.get( + 'cover.test').attributes['supported_features'] == 4) + + fire_mqtt_message(self.hass, 'state-topic', '22') + self.hass.block_till_done() + state_attributes_dict = self.hass.states.get( + 'cover.test').attributes + self.assertTrue('current_position' in state_attributes_dict) + self.assertFalse('current_tilt_position' in state_attributes_dict) + current_cover_position = self.hass.states.get( + 'cover.test').attributes['current_position'] + self.assertEqual(22, current_cover_position) + + def test_set_position_templated(self): + """Test setting cover position via template.""" + self.assertTrue(setup_component(self.hass, cover.DOMAIN, { + cover.DOMAIN: { + 'platform': 'mqtt', + 'name': 'test', + 'state_topic': 'state-topic', + 'command_topic': 'command-topic', + 'set_position_topic': 'position-topic', + 'set_position_template': '{{100-62}}', + 'payload_open': 'OPEN', + 'payload_close': 'CLOSE', + 'payload_stop': 'STOP' + } + })) + + cover.set_cover_position(self.hass, 100, 'cover.test') + self.hass.block_till_done() + + self.assertEqual(('position-topic', '38', 0, False), + self.mock_publish.mock_calls[-2][1]) + + def test_set_position_untemplated(self): + """Test setting cover position via template.""" + self.assertTrue(setup_component(self.hass, cover.DOMAIN, { + cover.DOMAIN: { + 'platform': 'mqtt', + 'name': 'test', + 'state_topic': 'state-topic', + 'command_topic': 'command-topic', + 'set_position_topic': 'position-topic', + 'payload_open': 'OPEN', + 'payload_close': 'CLOSE', + 'payload_stop': 'STOP' + } + })) + + cover.set_cover_position(self.hass, 62, 'cover.test') + self.hass.block_till_done() + + self.assertEqual(('position-topic', 62, 0, False), + self.mock_publish.mock_calls[-2][1]) + + + def test_no_command_topic(self): + """Test with no command topic.""" + self.assertTrue(setup_component(self.hass, cover.DOMAIN, { + cover.DOMAIN: { + 'platform': 'mqtt', + 'name': 'test', + 'qos': 0, + 'payload_open': 'OPEN', + 'payload_close': 'CLOSE', + 'payload_stop': 'STOP', + 'tilt_command_topic': 'tilt-command', + 'tilt_status_topic': 'tilt-status' + } + })) + + state_attributes_dict = self.hass.states.get( + 'cover.test').attributes + + self.assertEqual(240, self.hass.states.get( + 'cover.test').attributes['supported_features']) + + def test_with_command_topic_and_tilt(self): + """Test with command topic and tilt config.""" + self.assertTrue(setup_component(self.hass, cover.DOMAIN, { + cover.DOMAIN: { + 'command_topic': 'test', + 'platform': 'mqtt', + 'name': 'test', + 'qos': 0, + 'payload_open': 'OPEN', + 'payload_close': 'CLOSE', + 'payload_stop': 'STOP', + 'tilt_command_topic': 'tilt-command', + 'tilt_status_topic': 'tilt-status' + } + })) + + state_attributes_dict = self.hass.states.get( + 'cover.test').attributes + + self.assertEqual(251, self.hass.states.get( + 'cover.test').attributes['supported_features']) + def test_tilt_defaults(self): """Test the defaults.""" self.assertTrue(setup_component(self.hass, cover.DOMAIN, { @@ -455,71 +577,71 @@ def test_tilt_position_altered_range(self): def test_find_percentage_in_range_defaults(self): """Test find percentage in range with default range.""" mqtt_cover = MqttCover( - 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, - 100, 0, 0, 100, False, False) + 100, 0, 0, 100, False, False, None, None) self.assertEqual(44, mqtt_cover.find_percentage_in_range(44)) def test_find_percentage_in_range_altered(self): """Test find percentage in range with altered range.""" mqtt_cover = MqttCover( - 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, - 180, 80, 80, 180, False, False) + 180, 80, 80, 180, False, False, None, None) self.assertEqual(40, mqtt_cover.find_percentage_in_range(120)) def test_find_percentage_in_range_defaults_inverted(self): """Test find percentage in range with default range but inverted.""" mqtt_cover = MqttCover( - 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, - 100, 0, 0, 100, False, True) + 100, 0, 0, 100, False, True, None, None) self.assertEqual(56, mqtt_cover.find_percentage_in_range(44)) def test_find_percentage_in_range_altered_inverted(self): """Test find percentage in range with altered range and inverted.""" mqtt_cover = MqttCover( - 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, - 180, 80, 80, 180, False, True) + 180, 80, 80, 180, False, True, None, None) self.assertEqual(60, mqtt_cover.find_percentage_in_range(120)) def test_find_in_range_defaults(self): """Test find in range with default range.""" mqtt_cover = MqttCover( - 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, - 100, 0, 0, 100, False, False) + 100, 0, 0, 100, False, False, None, None) self.assertEqual(44, mqtt_cover.find_in_range_from_percent(44)) def test_find_in_range_altered(self): """Test find in range with altered range.""" mqtt_cover = MqttCover( - 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, - 180, 80, 80, 180, False, False) + 180, 80, 80, 180, False, False, None, None) self.assertEqual(120, mqtt_cover.find_in_range_from_percent(40)) def test_find_in_range_defaults_inverted(self): """Test find in range with default range but inverted.""" mqtt_cover = MqttCover( - 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, - 100, 0, 0, 100, False, True) + 100, 0, 0, 100, False, True, None, None) self.assertEqual(44, mqtt_cover.find_in_range_from_percent(56)) def test_find_in_range_altered_inverted(self): """Test find in range with altered range and inverted.""" mqtt_cover = MqttCover( - 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, - 180, 80, 80, 180, False, True) + 180, 80, 80, 180, False, True, None, None) self.assertEqual(120, mqtt_cover.find_in_range_from_percent(60)) From 0d93c3ccb3fac3b19cc576aed21bbc51cb7d428e Mon Sep 17 00:00:00 2001 From: Brian Cribbs Date: Tue, 30 May 2017 17:55:07 -0400 Subject: [PATCH 2/7] flaking --- homeassistant/components/cover/mqtt.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/cover/mqtt.py b/homeassistant/components/cover/mqtt.py index 1b8c06774eff16..bcd6a513ab6d68 100644 --- a/homeassistant/components/cover/mqtt.py +++ b/homeassistant/components/cover/mqtt.py @@ -16,6 +16,7 @@ SUPPORT_CLOSE_TILT, SUPPORT_STOP_TILT, SUPPORT_SET_TILT_POSITION, SUPPORT_OPEN, SUPPORT_CLOSE, SUPPORT_STOP, SUPPORT_SET_POSITION, ATTR_POSITION) +from homeassistant.exceptions import TemplateError from homeassistant.const import ( CONF_NAME, CONF_VALUE_TEMPLATE, CONF_OPTIMISTIC, STATE_OPEN, STATE_CLOSED, STATE_UNKNOWN) @@ -98,7 +99,8 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None): if value_template is not None: value_template.hass = hass - async_add_devices([MqttCover(hass, + async_add_devices([MqttCover( + hass, config.get(CONF_NAME), config.get(CONF_STATE_TOPIC), config.get(CONF_COMMAND_TOPIC), @@ -127,7 +129,8 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None): class MqttCover(CoverDevice): """Representation of a cover that can be controlled using MQTT.""" - def __init__(self, hass, name, state_topic, command_topic, tilt_command_topic, + def __init__(self, hass, name, state_topic, command_topic, + tilt_command_topic, tilt_status_topic, qos, retain, state_open, state_closed, payload_open, payload_close, payload_stop, optimistic, value_template, tilt_open_position, @@ -335,7 +338,7 @@ def async_set_cover_tilt_position(self, **kwargs): mqtt.async_publish(self.hass, self._tilt_command_topic, level, self._qos, self._retain) - + @asyncio.coroutine def async_set_cover_position(self, **kwargs): """Move the cover to a specific position.""" @@ -347,10 +350,9 @@ def async_set_cover_position(self, **kwargs): except TemplateError as ex: _LOGGER.error(ex) self._state = None - - mqtt.async_publish(self.hass, self._position_topic, - position, self._qos, self._retain) + mqtt.async_publish(self.hass, self._position_topic, + position, self._qos, self._retain) def find_percentage_in_range(self, position): """Find the 0-100% value within the specified range.""" From e36e0b394129714d11b46c182139d6ab5faf06d1 Mon Sep 17 00:00:00 2001 From: Brian Cribbs Date: Tue, 30 May 2017 18:20:14 -0400 Subject: [PATCH 3/7] flaking test --- tests/components/cover/test_mqtt.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/tests/components/cover/test_mqtt.py b/tests/components/cover/test_mqtt.py index 7224177c5be21a..de34fe369cbdc9 100644 --- a/tests/components/cover/test_mqtt.py +++ b/tests/components/cover/test_mqtt.py @@ -274,7 +274,7 @@ def test_set_cover_position(self): current_cover_position = self.hass.states.get( 'cover.test').attributes['current_position'] self.assertEqual(22, current_cover_position) - + def test_set_position_templated(self): """Test setting cover position via template.""" self.assertTrue(setup_component(self.hass, cover.DOMAIN, { @@ -318,7 +318,6 @@ def test_set_position_untemplated(self): self.assertEqual(('position-topic', 62, 0, False), self.mock_publish.mock_calls[-2][1]) - def test_no_command_topic(self): """Test with no command topic.""" self.assertTrue(setup_component(self.hass, cover.DOMAIN, { @@ -334,9 +333,6 @@ def test_no_command_topic(self): } })) - state_attributes_dict = self.hass.states.get( - 'cover.test').attributes - self.assertEqual(240, self.hass.states.get( 'cover.test').attributes['supported_features']) @@ -356,9 +352,6 @@ def test_with_command_topic_and_tilt(self): } })) - state_attributes_dict = self.hass.states.get( - 'cover.test').attributes - self.assertEqual(251, self.hass.states.get( 'cover.test').attributes['supported_features']) From 9cfc5ed7a8f5761de93d8bc7c1cfb81fa8d7ca40 Mon Sep 17 00:00:00 2001 From: Brian Cribbs Date: Wed, 31 May 2017 11:04:47 -0400 Subject: [PATCH 4/7] updating docs --- .../components/frontend/www_static/home-assistant-polymer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/frontend/www_static/home-assistant-polymer b/homeassistant/components/frontend/www_static/home-assistant-polymer index 6858555c86f18e..67739e7d12dc9f 160000 --- a/homeassistant/components/frontend/www_static/home-assistant-polymer +++ b/homeassistant/components/frontend/www_static/home-assistant-polymer @@ -1 +1 @@ -Subproject commit 6858555c86f18eb0ab176008e9aa2c3842fec7ce +Subproject commit 67739e7d12dc9fbe87a8b6feabe2d2eea3cd65d4 From 43747e513876f09be4e67f232517602c8c9f3ccb Mon Sep 17 00:00:00 2001 From: Brian Cribbs Date: Wed, 31 May 2017 11:13:05 -0400 Subject: [PATCH 5/7] requested updates --- homeassistant/components/cover/mqtt.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/cover/mqtt.py b/homeassistant/components/cover/mqtt.py index bcd6a513ab6d68..a53e659c448e20 100644 --- a/homeassistant/components/cover/mqtt.py +++ b/homeassistant/components/cover/mqtt.py @@ -98,9 +98,11 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None): value_template = config.get(CONF_VALUE_TEMPLATE) if value_template is not None: value_template.hass = hass + set_position_template = config.get(CONF_SET_POSITION_TEMPLATE) + if set_position_template is not None: + set_position_template.hass = hass async_add_devices([MqttCover( - hass, config.get(CONF_NAME), config.get(CONF_STATE_TOPIC), config.get(CONF_COMMAND_TOPIC), @@ -122,15 +124,14 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None): config.get(CONF_TILT_STATE_OPTIMISTIC), config.get(CONF_TILT_INVERT_STATE), config.get(CONF_POSITION_TOPIC), - config.get(CONF_SET_POSITION_TEMPLATE), + set_position_template, )]) class MqttCover(CoverDevice): """Representation of a cover that can be controlled using MQTT.""" - def __init__(self, hass, name, state_topic, command_topic, - tilt_command_topic, + def __init__(self, name, state_topic, command_topic, tilt_command_topic, tilt_status_topic, qos, retain, state_open, state_closed, payload_open, payload_close, payload_stop, optimistic, value_template, tilt_open_position, @@ -162,8 +163,6 @@ def __init__(self, hass, name, state_topic, command_topic, self._tilt_invert = tilt_invert self._position_topic = position_topic self._set_position_template = set_position_template - if set_position_template is not None: - self._set_position_template.hass = hass @asyncio.coroutine def async_added_to_hass(self): @@ -259,9 +258,6 @@ def supported_features(self): if self._position_topic is not None: supported_features |= SUPPORT_SET_POSITION - if self.current_cover_position is not None: - supported_features |= SUPPORT_SET_POSITION - if self._tilt_command_topic is not None: supported_features |= TILT_FEATURES @@ -346,7 +342,8 @@ def async_set_cover_position(self, **kwargs): position = kwargs[ATTR_POSITION] if self._set_position_template is not None: try: - position = self._set_position_template.async_render() + position = self._set_position_template.async_render( + **kwargs) except TemplateError as ex: _LOGGER.error(ex) self._state = None From 9931659f338c5c4909aee7e3f28898b099d894a3 Mon Sep 17 00:00:00 2001 From: Brian Cribbs Date: Wed, 31 May 2017 11:28:51 -0400 Subject: [PATCH 6/7] Revert "updating docs" This reverts commit 9cfc5ed7a8f5761de93d8bc7c1cfb81fa8d7ca40. --- .../components/frontend/www_static/home-assistant-polymer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/frontend/www_static/home-assistant-polymer b/homeassistant/components/frontend/www_static/home-assistant-polymer index 67739e7d12dc9f..6858555c86f18e 160000 --- a/homeassistant/components/frontend/www_static/home-assistant-polymer +++ b/homeassistant/components/frontend/www_static/home-assistant-polymer @@ -1 +1 @@ -Subproject commit 67739e7d12dc9fbe87a8b6feabe2d2eea3cd65d4 +Subproject commit 6858555c86f18eb0ab176008e9aa2c3842fec7ce From 5c714581ffa976f9113da2222c7332eae0b4336d Mon Sep 17 00:00:00 2001 From: Brian Cribbs Date: Wed, 31 May 2017 16:14:43 -0400 Subject: [PATCH 7/7] forgot to update constructor calls in tests --- tests/components/cover/test_mqtt.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/components/cover/test_mqtt.py b/tests/components/cover/test_mqtt.py index de34fe369cbdc9..8b6202acdffc7c 100644 --- a/tests/components/cover/test_mqtt.py +++ b/tests/components/cover/test_mqtt.py @@ -570,7 +570,7 @@ def test_tilt_position_altered_range(self): def test_find_percentage_in_range_defaults(self): """Test find percentage in range with default range.""" mqtt_cover = MqttCover( - None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, 100, 0, 0, 100, False, False, None, None) @@ -579,7 +579,7 @@ def test_find_percentage_in_range_defaults(self): def test_find_percentage_in_range_altered(self): """Test find percentage in range with altered range.""" mqtt_cover = MqttCover( - None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, 180, 80, 80, 180, False, False, None, None) @@ -588,7 +588,7 @@ def test_find_percentage_in_range_altered(self): def test_find_percentage_in_range_defaults_inverted(self): """Test find percentage in range with default range but inverted.""" mqtt_cover = MqttCover( - None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, 100, 0, 0, 100, False, True, None, None) @@ -597,7 +597,7 @@ def test_find_percentage_in_range_defaults_inverted(self): def test_find_percentage_in_range_altered_inverted(self): """Test find percentage in range with altered range and inverted.""" mqtt_cover = MqttCover( - None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, 180, 80, 80, 180, False, True, None, None) @@ -606,7 +606,7 @@ def test_find_percentage_in_range_altered_inverted(self): def test_find_in_range_defaults(self): """Test find in range with default range.""" mqtt_cover = MqttCover( - None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, 100, 0, 0, 100, False, False, None, None) @@ -615,7 +615,7 @@ def test_find_in_range_defaults(self): def test_find_in_range_altered(self): """Test find in range with altered range.""" mqtt_cover = MqttCover( - None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, 180, 80, 80, 180, False, False, None, None) @@ -624,7 +624,7 @@ def test_find_in_range_altered(self): def test_find_in_range_defaults_inverted(self): """Test find in range with default range but inverted.""" mqtt_cover = MqttCover( - None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, 100, 0, 0, 100, False, True, None, None) @@ -633,7 +633,7 @@ def test_find_in_range_defaults_inverted(self): def test_find_in_range_altered_inverted(self): """Test find in range with altered range and inverted.""" mqtt_cover = MqttCover( - None, 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, + 'cover.test', 'foo', 'bar', 'fooBar', "fooBarBaz", 0, False, 'OPEN', 'CLOSE', 'OPEN', 'CLOSE', 'STOP', False, None, 180, 80, 80, 180, False, True, None, None)