Use zeroconf attributes in freebox (#58967)
* Use zeroconf attributes in freebox * Use zeroconf.HaServiceInfo in tests
This commit is contained in:
parent
9eaf8bd21b
commit
cf22bd8807
2 changed files with 17 additions and 11 deletions
|
@ -5,7 +5,10 @@ from freebox_api.exceptions import AuthorizationError, HttpRequestError
|
|||
import voluptuous as vol
|
||||
|
||||
from homeassistant import config_entries
|
||||
from homeassistant.components import zeroconf
|
||||
from homeassistant.const import CONF_HOST, CONF_PORT
|
||||
from homeassistant.data_entry_flow import FlowResult
|
||||
from homeassistant.helpers.typing import DiscoveryInfoType
|
||||
|
||||
from .const import DOMAIN
|
||||
from .router import get_api
|
||||
|
@ -105,8 +108,10 @@ class FreeboxFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
|||
"""Import a config entry."""
|
||||
return await self.async_step_user(user_input)
|
||||
|
||||
async def async_step_zeroconf(self, discovery_info: dict):
|
||||
async def async_step_zeroconf(
|
||||
self, discovery_info: DiscoveryInfoType
|
||||
) -> FlowResult:
|
||||
"""Initialize flow from zeroconf."""
|
||||
host = discovery_info["properties"]["api_domain"]
|
||||
port = discovery_info["properties"]["https_port"]
|
||||
host = discovery_info[zeroconf.ATTR_PROPERTIES]["api_domain"]
|
||||
port = discovery_info[zeroconf.ATTR_PROPERTIES]["https_port"]
|
||||
return await self.async_step_user({CONF_HOST: host, CONF_PORT: port})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue