Fix formatting of mac addresses from dhcp discovery mocking in broadlink (#110558)

* Fix formatting of mac addresses from dhcp discovery mocking in broadlink

dhcp returns addresses in lowercase without :

* fix missed ones

* broadlink has same format
pull/110622/head
J. Nick Koston 2024-02-14 16:26:14 -06:00 committed by GitHub
parent 78bc561700
commit 499c42364e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 8 deletions

View File

@ -10,7 +10,6 @@ from homeassistant import config_entries
from homeassistant.components import dhcp from homeassistant.components import dhcp
from homeassistant.components.broadlink.const import DOMAIN from homeassistant.components.broadlink.const import DOMAIN
from homeassistant.core import HomeAssistant from homeassistant.core import HomeAssistant
from homeassistant.helpers import device_registry as dr
from . import get_device from . import get_device
@ -838,7 +837,7 @@ async def test_dhcp_can_finish(hass: HomeAssistant) -> None:
data=dhcp.DhcpServiceInfo( data=dhcp.DhcpServiceInfo(
hostname="broadlink", hostname="broadlink",
ip="1.2.3.4", ip="1.2.3.4",
macaddress=dr.format_mac(device.mac), macaddress=device.mac,
), ),
) )
await hass.async_block_till_done() await hass.async_block_till_done()
@ -872,7 +871,7 @@ async def test_dhcp_fails_to_connect(hass: HomeAssistant) -> None:
data=dhcp.DhcpServiceInfo( data=dhcp.DhcpServiceInfo(
hostname="broadlink", hostname="broadlink",
ip="1.2.3.4", ip="1.2.3.4",
macaddress="34:ea:34:b4:3b:5a", macaddress="34ea34b43b5a",
), ),
) )
await hass.async_block_till_done() await hass.async_block_till_done()
@ -891,7 +890,7 @@ async def test_dhcp_unreachable(hass: HomeAssistant) -> None:
data=dhcp.DhcpServiceInfo( data=dhcp.DhcpServiceInfo(
hostname="broadlink", hostname="broadlink",
ip="1.2.3.4", ip="1.2.3.4",
macaddress="34:ea:34:b4:3b:5a", macaddress="34ea34b43b5a",
), ),
) )
await hass.async_block_till_done() await hass.async_block_till_done()
@ -910,7 +909,7 @@ async def test_dhcp_connect_unknown_error(hass: HomeAssistant) -> None:
data=dhcp.DhcpServiceInfo( data=dhcp.DhcpServiceInfo(
hostname="broadlink", hostname="broadlink",
ip="1.2.3.4", ip="1.2.3.4",
macaddress="34:ea:34:b4:3b:5a", macaddress="34ea34b43b5a",
), ),
) )
await hass.async_block_till_done() await hass.async_block_till_done()
@ -932,7 +931,7 @@ async def test_dhcp_device_not_supported(hass: HomeAssistant) -> None:
data=dhcp.DhcpServiceInfo( data=dhcp.DhcpServiceInfo(
hostname="broadlink", hostname="broadlink",
ip=device.host, ip=device.host,
macaddress=dr.format_mac(device.mac), macaddress=device.mac,
), ),
) )
@ -956,7 +955,7 @@ async def test_dhcp_already_exists(hass: HomeAssistant) -> None:
data=dhcp.DhcpServiceInfo( data=dhcp.DhcpServiceInfo(
hostname="broadlink", hostname="broadlink",
ip="1.2.3.4", ip="1.2.3.4",
macaddress="34:ea:34:b4:3b:5a", macaddress="34ea34b43b5a",
), ),
) )
await hass.async_block_till_done() await hass.async_block_till_done()
@ -981,7 +980,7 @@ async def test_dhcp_updates_host(hass: HomeAssistant) -> None:
data=dhcp.DhcpServiceInfo( data=dhcp.DhcpServiceInfo(
hostname="broadlink", hostname="broadlink",
ip="4.5.6.7", ip="4.5.6.7",
macaddress="34:ea:34:b4:3b:5a", macaddress="34ea34b43b5a",
), ),
) )
await hass.async_block_till_done() await hass.async_block_till_done()