mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Ensure entity platform in mochad tests (#135725)
This commit is contained in:
parent
8e39c65759
commit
cd88913daf
@ -9,6 +9,8 @@ from homeassistant.components.mochad import switch as mochad
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import MockEntityPlatform
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def pymochad_mock():
|
||||
@ -25,7 +27,9 @@ def switch_mock(hass: HomeAssistant) -> mochad.MochadSwitch:
|
||||
"""Mock switch."""
|
||||
controller_mock = mock.MagicMock()
|
||||
dev_dict = {"address": "a1", "name": "fake_switch"}
|
||||
return mochad.MochadSwitch(hass, controller_mock, dev_dict)
|
||||
entity = mochad.MochadSwitch(hass, controller_mock, dev_dict)
|
||||
entity.platform = MockEntityPlatform(hass)
|
||||
return entity
|
||||
|
||||
|
||||
async def test_setup_adds_proper_devices(hass: HomeAssistant) -> None:
|
||||
|
Loading…
x
Reference in New Issue
Block a user