Skip to content

Commit 3046c7a

Browse files
authored
Fix shelly RuntimeWarnings in tests (home-assistant#158101)
1 parent 73dc810 commit 3046c7a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/components/shelly/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,8 @@ def _mock_blu_rtv_device(version: str | None = None):
603603
}
604604
),
605605
xmod_info={},
606+
wifi_setconfig=AsyncMock(return_value={}),
607+
ble_setconfig=AsyncMock(return_value={}),
606608
)
607609
type(device).name = PropertyMock(return_value="Test name")
608610
return device

tests/components/shelly/test_config_flow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from datetime import timedelta
66
from ipaddress import ip_address
77
from typing import Any
8-
from unittest.mock import AsyncMock, Mock, call, patch
8+
from unittest.mock import AsyncMock, MagicMock, Mock, call, patch
99

1010
from aioshelly.const import DEFAULT_HTTP_PORT, MODEL_1, MODEL_PLUS_2PM
1111
from aioshelly.exceptions import (
@@ -356,6 +356,8 @@ def create_mock_rpc_device(
356356
mock_device.wifi_setconfig = AsyncMock(return_value={})
357357
mock_device.ble_setconfig = AsyncMock(return_value={"restart_required": False})
358358
mock_device.shutdown = AsyncMock()
359+
mock_device.config = MagicMock()
360+
mock_device.subscribe_updates = MagicMock()
359361
return mock_device
360362

361363

0 commit comments

Comments
 (0)