Fix Daikin zeroconf discovery flow error (#36868)

This commit is contained in:
Fredrik Erlandsson 2020-06-17 16:53:29 +02:00 committed by GitHub
parent a74e35795c
commit b3c851502d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -129,7 +129,7 @@ class FlowHandler(config_entries.ConfigFlow):
async def async_step_zeroconf(self, discovery_info):
"""Prepare configuration for a discovered Daikin device."""
_LOGGER.debug("Zeroconf user_input: %s", discovery_info)
devices = Discovery.poll(discovery_info[CONF_HOST])
devices = Discovery().poll(ip=discovery_info[CONF_HOST])
await self.async_set_unique_id(next(iter(devices.values()))[KEY_MAC])
self._abort_if_unique_id_configured()
self.host = discovery_info[CONF_HOST]

View file

@ -45,9 +45,9 @@ def mock_daikin():
def mock_daikin_discovery():
"""Mock pydaikin Discovery."""
with patch("homeassistant.components.daikin.config_flow.Discovery") as Discovery:
Discovery.poll = PropertyMock(
return_value={"127.0.01": {"mac": "AABBCCDDEEFF", "id": "test"}}
)
Discovery().poll.return_value = {
"127.0.01": {"mac": "AABBCCDDEEFF", "id": "test"}
}
yield Discovery