Cleanup Shelly imports (#86359)

* Cleanup Shelly imports

* Cleanup tests
This commit is contained in:
Shay Levy 2023-01-22 01:26:54 +02:00 committed by GitHub
parent 164fad112c
commit d5797d9f7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 141 additions and 157 deletions

View file

@ -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)