Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatting of mac addresses from dhcp discovery mocking in lifx #110581

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/components/lifx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
GROUP = "My Group"
SERIAL = "aa:bb:cc:dd:ee:cc"
MAC_ADDRESS = "aa:bb:cc:dd:ee:cd"
DHCP_FORMATTED_MAC = "aabbccddeecd"
DEFAULT_ENTRY_TITLE = LABEL


Expand Down
20 changes: 13 additions & 7 deletions tests/components/lifx/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

from . import (
DEFAULT_ENTRY_TITLE,
DHCP_FORMATTED_MAC,
IP_ADDRESS,
LABEL,
MAC_ADDRESS,
MODULE,
SERIAL,
_mocked_bulb,
Expand Down Expand Up @@ -345,7 +345,7 @@ async def test_discovered_by_discovery_and_dhcp(hass: HomeAssistant) -> None:
DOMAIN,
context={"source": config_entries.SOURCE_DHCP},
data=dhcp.DhcpServiceInfo(
ip=IP_ADDRESS, macaddress=MAC_ADDRESS, hostname=LABEL
ip=IP_ADDRESS, macaddress=DHCP_FORMATTED_MAC, hostname=LABEL
),
)
await hass.async_block_till_done()
Expand All @@ -357,7 +357,7 @@ async def test_discovered_by_discovery_and_dhcp(hass: HomeAssistant) -> None:
DOMAIN,
context={"source": config_entries.SOURCE_DHCP},
data=dhcp.DhcpServiceInfo(
ip=IP_ADDRESS, macaddress="00:00:00:00:00:00", hostname="mock_hostname"
ip=IP_ADDRESS, macaddress="000000000000", hostname="mock_hostname"
),
)
await hass.async_block_till_done()
Expand All @@ -371,7 +371,7 @@ async def test_discovered_by_discovery_and_dhcp(hass: HomeAssistant) -> None:
DOMAIN,
context={"source": config_entries.SOURCE_DHCP},
data=dhcp.DhcpServiceInfo(
ip="1.2.3.5", macaddress="00:00:00:00:00:01", hostname="mock_hostname"
ip="1.2.3.5", macaddress="000000000001", hostname="mock_hostname"
),
)
await hass.async_block_till_done()
Expand All @@ -384,7 +384,9 @@ async def test_discovered_by_discovery_and_dhcp(hass: HomeAssistant) -> None:
[
(
config_entries.SOURCE_DHCP,
dhcp.DhcpServiceInfo(ip=IP_ADDRESS, macaddress=MAC_ADDRESS, hostname=LABEL),
dhcp.DhcpServiceInfo(
ip=IP_ADDRESS, macaddress=DHCP_FORMATTED_MAC, hostname=LABEL
),
),
(
config_entries.SOURCE_HOMEKIT,
Expand Down Expand Up @@ -439,7 +441,9 @@ async def test_discovered_by_dhcp_or_discovery(
[
(
config_entries.SOURCE_DHCP,
dhcp.DhcpServiceInfo(ip=IP_ADDRESS, macaddress=MAC_ADDRESS, hostname=LABEL),
dhcp.DhcpServiceInfo(
ip=IP_ADDRESS, macaddress=DHCP_FORMATTED_MAC, hostname=LABEL
),
),
(
config_entries.SOURCE_HOMEKIT,
Expand Down Expand Up @@ -480,7 +484,9 @@ async def test_discovered_by_dhcp_or_discovery_failed_to_get_device(
[
(
config_entries.SOURCE_DHCP,
dhcp.DhcpServiceInfo(ip=IP_ADDRESS, macaddress=MAC_ADDRESS, hostname=LABEL),
dhcp.DhcpServiceInfo(
ip=IP_ADDRESS, macaddress=DHCP_FORMATTED_MAC, hostname=LABEL
),
),
(
config_entries.SOURCE_HOMEKIT,
Expand Down
Loading