Cleanup Shelly imports (#86359)
* Cleanup Shelly imports * Cleanup tests
This commit is contained in:
parent
164fad112c
commit
d5797d9f7d
11 changed files with 141 additions and 157 deletions
|
@ -13,7 +13,7 @@ from homeassistant.components.shelly.const import (
|
|||
)
|
||||
from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntryState
|
||||
from homeassistant.const import STATE_ON, STATE_UNAVAILABLE
|
||||
from homeassistant.helpers import device_registry
|
||||
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, format_mac
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from . import MOCK_MAC, init_integration
|
||||
|
@ -43,12 +43,7 @@ async def test_shared_device_mac(
|
|||
config_entry.add_to_hass(hass)
|
||||
device_reg.async_get_or_create(
|
||||
config_entry_id=config_entry.entry_id,
|
||||
connections={
|
||||
(
|
||||
device_registry.CONNECTION_NETWORK_MAC,
|
||||
device_registry.format_mac(MOCK_MAC),
|
||||
)
|
||||
},
|
||||
connections={(CONNECTION_NETWORK_MAC, format_mac(MOCK_MAC))},
|
||||
)
|
||||
await init_integration(hass, gen, sleep_period=1000)
|
||||
assert "will resume when device is online" in caplog.text
|
||||
|
@ -117,12 +112,7 @@ async def test_sleeping_block_device_online(
|
|||
config_entry.add_to_hass(hass)
|
||||
device_reg.async_get_or_create(
|
||||
config_entry_id=config_entry.entry_id,
|
||||
connections={
|
||||
(
|
||||
device_registry.CONNECTION_NETWORK_MAC,
|
||||
device_registry.format_mac(MOCK_MAC),
|
||||
)
|
||||
},
|
||||
connections={(CONNECTION_NETWORK_MAC, format_mac(MOCK_MAC))},
|
||||
)
|
||||
|
||||
entry = await init_integration(hass, 1, sleep_period=entry_sleep)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue