Add KEY_HOSTNAME for Daikin zeroconf (#36253)

* Add KEY_HOSTNAME for Daikin zeroconf

* Update tests and use CONF_HOST as hostname
This commit is contained in:
Fredrik Erlandsson authored and GitHub committed 2020-05-30 09:50:18 +02:00
1 parent e1c6f01047
commit efec62d98e
3 files changed
+10 -5

No files matched your search

@@ -11,7 +11,7 @@ import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_HOST, CONF_PASSWORD
from .const import CONF_KEY, CONF_UUID, KEY_IP, KEY_MAC, TIMEOUT
from .const import CONF_KEY, CONF_UUID, KEY_HOSTNAME, KEY_IP, KEY_MAC, TIMEOUT
_LOGGER = logging.getLogger(__name__)
@@ -128,7 +128,7 @@ class FlowHandler(config_entries.ConfigFlow):
async def async_step_zeroconf(self, discovery_info):
"""Prepare configuration for a discovered Daikin device."""
_LOGGER.debug("Zeroconf discovery_info: %s", discovery_info)
await self.async_set_unique_id(discovery_info.get(CONF_HOST))
await self.async_set_unique_id(discovery_info[KEY_HOSTNAME])
self._abort_if_unique_id_configured()
self.host = discovery_info.get(CONF_HOST)
self.host = discovery_info[CONF_HOST]
return await self.async_step_user()
+1
View File
@@ -64,5 +64,6 @@ CONF_UUID = "uuid"
KEY_MAC = "mac"
KEY_IP = "ip"
KEY_HOSTNAME = "hostname"
TIMEOUT = 60