mirror of
https://github.com/home-assistant/core.git
synced 2025-07-27 23:27:37 +00:00
Use ZeroconfServiceInfo in netatmo tests (#60048)
This commit is contained in:
parent
7e0ddd1d8c
commit
3cdca4a657
@ -2,6 +2,7 @@
|
|||||||
from unittest.mock import patch
|
from unittest.mock import patch
|
||||||
|
|
||||||
from homeassistant import config_entries, data_entry_flow, setup
|
from homeassistant import config_entries, data_entry_flow, setup
|
||||||
|
from homeassistant.components import zeroconf
|
||||||
from homeassistant.components.netatmo import config_flow
|
from homeassistant.components.netatmo import config_flow
|
||||||
from homeassistant.components.netatmo.const import (
|
from homeassistant.components.netatmo.const import (
|
||||||
CONF_NEW_AREA,
|
CONF_NEW_AREA,
|
||||||
@ -39,7 +40,10 @@ async def test_abort_if_existing_entry(hass):
|
|||||||
result = await hass.config_entries.flow.async_init(
|
result = await hass.config_entries.flow.async_init(
|
||||||
"netatmo",
|
"netatmo",
|
||||||
context={"source": config_entries.SOURCE_HOMEKIT},
|
context={"source": config_entries.SOURCE_HOMEKIT},
|
||||||
data={"host": "0.0.0.0", "properties": {"id": "aa:bb:cc:dd:ee:ff"}},
|
data=zeroconf.ZeroconfServiceInfo(
|
||||||
|
host="0.0.0.0",
|
||||||
|
properties={zeroconf.ATTR_PROPERTIES_ID: "aa:bb:cc:dd:ee:ff"},
|
||||||
|
),
|
||||||
)
|
)
|
||||||
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
|
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
|
||||||
assert result["reason"] == "already_configured"
|
assert result["reason"] == "already_configured"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user