1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 05:26:47 +00:00

Add support for Shelly battery operated devices (#45406)

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
Shay Levy
2021-02-03 18:03:22 +02:00
committed by GitHub
parent fcc14933d0
commit 0875f654c8
12 changed files with 366 additions and 105 deletions

View File

@@ -91,7 +91,11 @@ async def coap_wrapper(hass):
"""Setups a coap wrapper with mocked device."""
await async_setup_component(hass, "shelly", {})
config_entry = MockConfigEntry(domain=DOMAIN, data={})
config_entry = MockConfigEntry(
domain=DOMAIN,
data={"sleep_period": 0, "model": "SHSW-25"},
unique_id="12345678",
)
config_entry.add_to_hass(hass)
device = Mock(
@@ -99,6 +103,7 @@ async def coap_wrapper(hass):
settings=MOCK_SETTINGS,
shelly=MOCK_SHELLY,
update=AsyncMock(),
initialized=True,
)
hass.data[DOMAIN] = {DATA_CONFIG_ENTRY: {}}