diff --git a/tests/components/konnected/test_panel.py b/tests/components/konnected/test_panel.py index e7e5784ba71699..668e873eef7596 100644 --- a/tests/components/konnected/test_panel.py +++ b/tests/components/konnected/test_panel.py @@ -5,6 +5,7 @@ import pytest from homeassistant.components.konnected import config_flow, panel +from homeassistant.components.konnected.errors import CannotConnect from homeassistant.helpers.entity_component import async_update_entity from homeassistant.setup import async_setup_component from homeassistant.util import utcnow @@ -152,6 +153,11 @@ async def test_create_and_setup(hass, mock_panel): "endpoint": "http://192.168.1.1:8123/api/konnected", } + mock_panel.put_zone.side_effect = mock_panel.ClientError + mock_panel.put_device.side_effect = mock_panel.ClientError + with pytest.raises(CannotConnect): + await device.update_switch("1", 0) + # confirm the device settings are saved in hass.data assert device.stored_configuration == { "binary_sensors": {