From 514c42ad24cea7a7d64c6082a14d8f4718b0f7d3 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sat, 3 Nov 2018 18:56:53 +0100 Subject: [PATCH 1/3] Bugfix discovery delete call for Hass.io --- homeassistant/components/hassio/discovery.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/hassio/discovery.py b/homeassistant/components/hassio/discovery.py index 4c7c5a6597f55f..a5f62b9e1a1b4a 100644 --- a/homeassistant/components/hassio/discovery.py +++ b/homeassistant/components/hassio/discovery.py @@ -71,7 +71,7 @@ async def post(self, request, uuid): async def delete(self, request, uuid): """Handle remove discovery requests.""" - data = request.json() + data = await request.json() await self.async_process_del(data) return web.Response() From e0138efc8c63b0f0893be5c4d75528aa2899e9dc Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sat, 3 Nov 2018 21:52:14 +0100 Subject: [PATCH 2/3] Fix host --- homeassistant/components/mqtt/config_flow.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/mqtt/config_flow.py b/homeassistant/components/mqtt/config_flow.py index e0d1e692c6073b..aee825d06de3bf 100644 --- a/homeassistant/components/mqtt/config_flow.py +++ b/homeassistant/components/mqtt/config_flow.py @@ -6,7 +6,7 @@ from homeassistant import config_entries from homeassistant.const import ( - CONF_PASSWORD, CONF_PORT, CONF_USERNAME, CONF_PROTOCOL) + CONF_PASSWORD, CONF_PORT, CONF_USERNAME, CONF_PROTOCOL, CONF_HOST) from .const import CONF_BROKER, CONF_DISCOVERY, DEFAULT_DISCOVERY @@ -80,7 +80,7 @@ async def async_step_hassio_confirm(self, user_input=None): data = self._hassio_discovery can_connect = await self.hass.async_add_executor_job( try_connection, - data[CONF_BROKER], + data[CONF_HOST], data[CONF_PORT], data.get(CONF_USERNAME), data.get(CONF_PASSWORD), @@ -90,7 +90,7 @@ async def async_step_hassio_confirm(self, user_input=None): if can_connect: return self.async_create_entry( title=data['addon'], data={ - CONF_BROKER: data[CONF_BROKER], + CONF_BROKER: data[CONF_HOST], CONF_PORT: data[CONF_PORT], CONF_USERNAME: data.get(CONF_USERNAME), CONF_PASSWORD: data.get(CONF_PASSWORD), From 28f17835f144f5d6a120e6490a40c32c1eec43d2 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sat, 3 Nov 2018 21:54:08 +0100 Subject: [PATCH 3/3] fix tests --- tests/components/mqtt/test_config_flow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/components/mqtt/test_config_flow.py b/tests/components/mqtt/test_config_flow.py index 08bb4e54a39714..66bf9b97807046 100644 --- a/tests/components/mqtt/test_config_flow.py +++ b/tests/components/mqtt/test_config_flow.py @@ -119,7 +119,7 @@ async def test_hassio_confirm(hass, mock_try_connection, 'mqtt', data={ 'addon': 'Mock Addon', - 'broker': 'mock-broker', + 'host': 'mock-broker', 'port': 1883, 'username': 'mock-user', 'password': 'mock-pass',