mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Remove duplicated QNAP QSW format_mac call in config_flow (#74333)
qnap_qsw: config_flow: remove duplicated format_mac Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
This commit is contained in:
parent
d56a487169
commit
d9b326dd48
@ -78,7 +78,6 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
_LOGGER.debug("DHCP discovery detected QSW: %s", self._discovered_mac)
|
_LOGGER.debug("DHCP discovery detected QSW: %s", self._discovered_mac)
|
||||||
|
|
||||||
mac = format_mac(self._discovered_mac)
|
|
||||||
options = ConnectionOptions(self._discovered_url, "", "")
|
options = ConnectionOptions(self._discovered_url, "", "")
|
||||||
qsw = QnapQswApi(aiohttp_client.async_get_clientsession(self.hass), options)
|
qsw = QnapQswApi(aiohttp_client.async_get_clientsession(self.hass), options)
|
||||||
|
|
||||||
@ -87,7 +86,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
except QswError as err:
|
except QswError as err:
|
||||||
raise AbortFlow("cannot_connect") from err
|
raise AbortFlow("cannot_connect") from err
|
||||||
|
|
||||||
await self.async_set_unique_id(format_mac(mac))
|
await self.async_set_unique_id(format_mac(self._discovered_mac))
|
||||||
self._abort_if_unique_id_configured()
|
self._abort_if_unique_id_configured()
|
||||||
|
|
||||||
return await self.async_step_discovered_connection()
|
return await self.async_step_discovered_connection()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user