mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Use ZeroconfServiceInfo in nam (#60044)
This commit is contained in:
parent
f606ba3b23
commit
ba93a384a7
@ -126,7 +126,7 @@ class NAMFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
self, discovery_info: zeroconf.ZeroconfServiceInfo
|
||||
) -> FlowResult:
|
||||
"""Handle zeroconf discovery."""
|
||||
self.host = discovery_info[CONF_HOST]
|
||||
self.host = discovery_info[zeroconf.ATTR_HOST]
|
||||
self.context["title_placeholders"] = {"host": self.host}
|
||||
|
||||
# Do not probe the device if the host is already configured
|
||||
|
@ -6,12 +6,13 @@ from nettigo_air_monitor import ApiError, AuthFailed, CannotGetMac
|
||||
import pytest
|
||||
|
||||
from homeassistant import data_entry_flow
|
||||
from homeassistant.components import zeroconf
|
||||
from homeassistant.components.nam.const import DOMAIN
|
||||
from homeassistant.config_entries import SOURCE_REAUTH, SOURCE_USER, SOURCE_ZEROCONF
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
DISCOVERY_INFO = {"host": "10.10.2.3"}
|
||||
DISCOVERY_INFO = zeroconf.ZeroconfServiceInfo(host="10.10.2.3")
|
||||
VALID_CONFIG = {"host": "10.10.2.3"}
|
||||
VALID_AUTH = {"username": "fake_username", "password": "fake_password"}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user