mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Use dataclass properties in nuki discovery (#60731)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
037f4dbdb1
commit
3db3f264c2
@ -69,13 +69,13 @@ class NukiConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
|
|
||||||
async def async_step_dhcp(self, discovery_info: dhcp.DhcpServiceInfo) -> FlowResult:
|
async def async_step_dhcp(self, discovery_info: dhcp.DhcpServiceInfo) -> FlowResult:
|
||||||
"""Prepare configuration for a DHCP discovered Nuki bridge."""
|
"""Prepare configuration for a DHCP discovered Nuki bridge."""
|
||||||
await self.async_set_unique_id(int(discovery_info[dhcp.HOSTNAME][12:], 16))
|
await self.async_set_unique_id(int(discovery_info.hostname[12:], 16))
|
||||||
|
|
||||||
self._abort_if_unique_id_configured()
|
self._abort_if_unique_id_configured()
|
||||||
|
|
||||||
self.discovery_schema = vol.Schema(
|
self.discovery_schema = vol.Schema(
|
||||||
{
|
{
|
||||||
vol.Required(CONF_HOST, default=discovery_info[dhcp.IP_ADDRESS]): str,
|
vol.Required(CONF_HOST, default=discovery_info.ip): str,
|
||||||
vol.Required(CONF_PORT, default=DEFAULT_PORT): int,
|
vol.Required(CONF_PORT, default=DEFAULT_PORT): int,
|
||||||
vol.Required(CONF_TOKEN): str,
|
vol.Required(CONF_TOKEN): str,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user