Fix misaligned mac formatting in goalzero (#110574)
The DHCP mac address was being set as aabbcceeddff but the user step was setting it as aa:bb:cc:dd:ee:ff
This commit is contained in:
parent
5988db1670
commit
cc3783f999
4 changed files with 36 additions and 2 deletions
|
@ -35,6 +35,26 @@ async def test_setup_config_and_unload(hass: HomeAssistant) -> None:
|
|||
assert not hass.data.get(DOMAIN)
|
||||
|
||||
|
||||
async def test_setup_config_entry_incorrectly_formatted_mac(
|
||||
hass: HomeAssistant,
|
||||
) -> None:
|
||||
"""Test the mac address formatting is corrected."""
|
||||
entry = create_entry(hass)
|
||||
hass.config_entries.async_update_entry(entry, unique_id="AABBCCDDEEFF")
|
||||
mocked_yeti = await create_mocked_yeti()
|
||||
with patch("homeassistant.components.goalzero.Yeti", return_value=mocked_yeti):
|
||||
await hass.config_entries.async_setup(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
assert entry.state == ConfigEntryState.LOADED
|
||||
assert len(hass.config_entries.async_entries(DOMAIN)) == 1
|
||||
assert entry.data == CONF_DATA
|
||||
|
||||
assert await hass.config_entries.async_unload(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert entry.unique_id == "aa:bb:cc:dd:ee:ff"
|
||||
|
||||
|
||||
async def test_async_setup_entry_not_ready(hass: HomeAssistant) -> None:
|
||||
"""Test that it throws ConfigEntryNotReady when exception occurs during setup."""
|
||||
entry = create_entry(hass)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue