diff --git a/tests/components/mfi/test_sensor.py b/tests/components/mfi/test_sensor.py index 966dcbfd567..ad23039237c 100644 --- a/tests/components/mfi/test_sensor.py +++ b/tests/components/mfi/test_sensor.py @@ -97,7 +97,8 @@ async def test_setup_adds_proper_devices(hass): "homeassistant.components.mfi.sensor.MfiSensor", side_effect=mfi.MfiSensor ) as mock_sensor: ports = { - i: mock.MagicMock(model=model) for i, model in enumerate(mfi.SENSOR_MODELS) + i: mock.MagicMock(model=model, label=f"Port {i}", value=0) + for i, model in enumerate(mfi.SENSOR_MODELS) } ports["bad"] = mock.MagicMock(model="notasensor") mock_client.return_value.get_devices.return_value = [ diff --git a/tests/components/mfi/test_switch.py b/tests/components/mfi/test_switch.py index e700aad8353..b11dcdccb6e 100644 --- a/tests/components/mfi/test_switch.py +++ b/tests/components/mfi/test_switch.py @@ -31,7 +31,10 @@ async def test_setup_adds_proper_devices(hass): "homeassistant.components.mfi.switch.MfiSwitch", side_effect=mfi.MfiSwitch ) as mock_switch: ports = { - i: mock.MagicMock(model=model) for i, model in enumerate(mfi.SWITCH_MODELS) + i: mock.MagicMock( + model=model, label=f"Port {i}", output=False, data={}, ident=f"abcd-{i}" + ) + for i, model in enumerate(mfi.SWITCH_MODELS) } ports["bad"] = mock.MagicMock(model="notaswitch") print(ports["bad"].model)