mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Use DhcpServiceInfo in axis (#60092)
Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
parent
7560f11680
commit
2675c6d408
@ -5,7 +5,7 @@ import pytest
|
|||||||
import respx
|
import respx
|
||||||
|
|
||||||
from homeassistant import data_entry_flow
|
from homeassistant import data_entry_flow
|
||||||
from homeassistant.components import zeroconf
|
from homeassistant.components import dhcp, zeroconf
|
||||||
from homeassistant.components.axis import config_flow
|
from homeassistant.components.axis import config_flow
|
||||||
from homeassistant.components.axis.const import (
|
from homeassistant.components.axis.const import (
|
||||||
CONF_EVENTS,
|
CONF_EVENTS,
|
||||||
@ -16,7 +16,6 @@ from homeassistant.components.axis.const import (
|
|||||||
DEFAULT_VIDEO_SOURCE,
|
DEFAULT_VIDEO_SOURCE,
|
||||||
DOMAIN as AXIS_DOMAIN,
|
DOMAIN as AXIS_DOMAIN,
|
||||||
)
|
)
|
||||||
from homeassistant.components.dhcp import HOSTNAME, IP_ADDRESS, MAC_ADDRESS
|
|
||||||
from homeassistant.config_entries import (
|
from homeassistant.config_entries import (
|
||||||
SOURCE_DHCP,
|
SOURCE_DHCP,
|
||||||
SOURCE_IGNORE,
|
SOURCE_IGNORE,
|
||||||
@ -256,11 +255,11 @@ async def test_reauth_flow_update_configuration(hass):
|
|||||||
[
|
[
|
||||||
(
|
(
|
||||||
SOURCE_DHCP,
|
SOURCE_DHCP,
|
||||||
{
|
dhcp.DhcpServiceInfo(
|
||||||
HOSTNAME: f"axis-{MAC}",
|
hostname=f"axis-{MAC}",
|
||||||
IP_ADDRESS: DEFAULT_HOST,
|
ip=DEFAULT_HOST,
|
||||||
MAC_ADDRESS: MAC,
|
macaddress=MAC,
|
||||||
},
|
),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
SOURCE_SSDP,
|
SOURCE_SSDP,
|
||||||
@ -347,11 +346,11 @@ async def test_discovery_flow(hass, source: str, discovery_info: dict):
|
|||||||
[
|
[
|
||||||
(
|
(
|
||||||
SOURCE_DHCP,
|
SOURCE_DHCP,
|
||||||
{
|
dhcp.DhcpServiceInfo(
|
||||||
HOSTNAME: f"axis-{MAC}",
|
hostname=f"axis-{MAC}",
|
||||||
IP_ADDRESS: DEFAULT_HOST,
|
ip=DEFAULT_HOST,
|
||||||
MAC_ADDRESS: MAC,
|
macaddress=MAC,
|
||||||
},
|
),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
SOURCE_SSDP,
|
SOURCE_SSDP,
|
||||||
@ -393,11 +392,11 @@ async def test_discovered_device_already_configured(
|
|||||||
[
|
[
|
||||||
(
|
(
|
||||||
SOURCE_DHCP,
|
SOURCE_DHCP,
|
||||||
{
|
dhcp.DhcpServiceInfo(
|
||||||
HOSTNAME: f"axis-{MAC}",
|
hostname=f"axis-{MAC}",
|
||||||
IP_ADDRESS: "2.3.4.5",
|
ip="2.3.4.5",
|
||||||
MAC_ADDRESS: MAC,
|
macaddress=MAC,
|
||||||
},
|
),
|
||||||
80,
|
80,
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
@ -463,11 +462,11 @@ async def test_discovery_flow_updated_configuration(
|
|||||||
[
|
[
|
||||||
(
|
(
|
||||||
SOURCE_DHCP,
|
SOURCE_DHCP,
|
||||||
{
|
dhcp.DhcpServiceInfo(
|
||||||
HOSTNAME: "",
|
hostname="",
|
||||||
IP_ADDRESS: "",
|
ip="",
|
||||||
MAC_ADDRESS: "01234567890",
|
macaddress="01234567890",
|
||||||
},
|
),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
SOURCE_SSDP,
|
SOURCE_SSDP,
|
||||||
@ -505,7 +504,11 @@ async def test_discovery_flow_ignore_non_axis_device(
|
|||||||
[
|
[
|
||||||
(
|
(
|
||||||
SOURCE_DHCP,
|
SOURCE_DHCP,
|
||||||
{HOSTNAME: f"axis-{MAC}", IP_ADDRESS: "169.254.3.4", MAC_ADDRESS: MAC},
|
dhcp.DhcpServiceInfo(
|
||||||
|
hostname=f"axis-{MAC}",
|
||||||
|
ip="169.254.3.4",
|
||||||
|
macaddress=MAC,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
(
|
(
|
||||||
SOURCE_SSDP,
|
SOURCE_SSDP,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user