Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump aioesphomeapi to 1.5.0 #20986

Merged
merged 3 commits into from Feb 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/components/esphome/__init__.py
Expand Up @@ -31,7 +31,7 @@
ServiceCall

DOMAIN = 'esphome'
REQUIREMENTS = ['aioesphomeapi==1.4.2']
REQUIREMENTS = ['aioesphomeapi==1.5.0']


DISPATCHER_UPDATE_ENTITY = 'esphome_{entry_id}_update_{component_key}_{key}'
Expand Down
9 changes: 4 additions & 5 deletions homeassistant/components/esphome/config_flow.py
Expand Up @@ -55,19 +55,18 @@ async def async_step_user(self, user_input: Optional[ConfigType] = None,

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'
)

# 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'],
})

Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion tests/components/esphome/test_config_flow.py
Expand Up @@ -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'
Expand Down