Bump aioesphomeapi to 1.5.0 (#20986)

* Bump aioesphomeapi to 1.5.0

* Update requirements_all.txt

* Fix editor line length setting
This commit is contained in:
Otto Winter 2019-02-11 21:57:17 +01:00 committed by Fabian Affolter
parent 277f37423e
commit 55f9db6992
4 changed files with 9 additions and 8 deletions

View File

@ -31,7 +31,7 @@ if TYPE_CHECKING:
ServiceCall
DOMAIN = 'esphome'
REQUIREMENTS = ['aioesphomeapi==1.4.2']
REQUIREMENTS = ['aioesphomeapi==1.5.0']
DISPATCHER_UPDATE_ENTITY = 'esphome_{entry_id}_update_{component_key}_{key}'

View File

@ -55,11 +55,10 @@ class EsphomeFlowHandler(config_entries.ConfigFlow):
async def async_step_discovery(self, user_input: ConfigType):
"""Handle discovery."""
# mDNS hostname has additional '.' at end
hostname = user_input['hostname'][:-1]
hosts = (hostname, user_input['host'])
address = user_input['properties'].get(
'address', user_input['hostname'][:-1])
for entry in self._async_current_entries():
if entry.data['host'] in hosts:
if entry.data['host'] == address:
return self.async_abort(
reason='already_configured'
)
@ -67,7 +66,7 @@ class EsphomeFlowHandler(config_entries.ConfigFlow):
# Prefer .local addresses (mDNS is available after all, otherwise
# we wouldn't have received the discovery message)
return await self.async_step_user(user_input={
'host': hostname,
'host': address,
'port': user_input['port'],
})

View File

@ -102,7 +102,7 @@ aioautomatic==0.6.5
aiodns==1.1.1
# homeassistant.components.esphome
aioesphomeapi==1.4.2
aioesphomeapi==1.5.0
# homeassistant.components.freebox
aiofreepybox==0.0.6

View File

@ -242,7 +242,9 @@ async def test_discovery_already_configured_ip(hass, mock_client):
'host': '192.168.43.183',
'port': 6053,
'hostname': 'test8266.local.',
'properties': {}
'properties': {
"address": "192.168.43.183"
}
}
result = await flow.async_step_discovery(user_input=service_info)
assert result['type'] == 'abort'