diff --git a/homeassistant/components/homematicip_cloud/manifest.json b/homeassistant/components/homematicip_cloud/manifest.json index 42efeb73821..b4999f82006 100644 --- a/homeassistant/components/homematicip_cloud/manifest.json +++ b/homeassistant/components/homematicip_cloud/manifest.json @@ -3,7 +3,7 @@ "name": "HomematicIP Cloud", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/homematicip_cloud", - "requirements": ["homematicip==0.10.18"], + "requirements": ["homematicip==0.10.19"], "codeowners": ["@SukramJ"], "quality_scale": "platinum" } diff --git a/homeassistant/components/homematicip_cloud/switch.py b/homeassistant/components/homematicip_cloud/switch.py index f000aef0695..a63602a6922 100644 --- a/homeassistant/components/homematicip_cloud/switch.py +++ b/homeassistant/components/homematicip_cloud/switch.py @@ -4,6 +4,7 @@ from typing import Any, Dict from homematicip.aio.device import ( AsyncBrandSwitchMeasuring, + AsyncFullFlushInputSwitch, AsyncFullFlushSwitchMeasuring, AsyncHeatingSwitch2, AsyncMultiIOBox, @@ -43,7 +44,12 @@ async def async_setup_entry( ): entities.append(HomematicipSwitchMeasuring(hap, device)) elif isinstance( - device, (AsyncPlugableSwitch, AsyncPrintedCircuitBoardSwitchBattery) + device, + ( + AsyncPlugableSwitch, + AsyncPrintedCircuitBoardSwitchBattery, + AsyncFullFlushInputSwitch, + ), ): entities.append(HomematicipSwitch(hap, device)) elif isinstance(device, AsyncOpenCollector8Module): diff --git a/requirements_all.txt b/requirements_all.txt index 1b912b76f41..ad09c566745 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -733,7 +733,7 @@ homeassistant-pyozw==0.1.10 homeconnect==0.5 # homeassistant.components.homematicip_cloud -homematicip==0.10.18 +homematicip==0.10.19 # homeassistant.components.horizon horimote==0.4.1 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 3957c8dd7ad..86e89c36bfd 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -359,7 +359,7 @@ homeassistant-pyozw==0.1.10 homeconnect==0.5 # homeassistant.components.homematicip_cloud -homematicip==0.10.18 +homematicip==0.10.19 # homeassistant.components.google # homeassistant.components.remember_the_milk diff --git a/tests/components/homematicip_cloud/test_device.py b/tests/components/homematicip_cloud/test_device.py index 8ea44795c96..f43e0ddafae 100644 --- a/tests/components/homematicip_cloud/test_device.py +++ b/tests/components/homematicip_cloud/test_device.py @@ -22,7 +22,7 @@ async def test_hmip_load_all_supported_devices(hass, default_mock_hap_factory): test_devices=None, test_groups=None ) - assert len(mock_hap.hmip_device_by_entity_id) == 186 + assert len(mock_hap.hmip_device_by_entity_id) == 187 async def test_hmip_remove_device(hass, default_mock_hap_factory): diff --git a/tests/components/homematicip_cloud/test_switch.py b/tests/components/homematicip_cloud/test_switch.py index 0cd01154753..59690458881 100644 --- a/tests/components/homematicip_cloud/test_switch.py +++ b/tests/components/homematicip_cloud/test_switch.py @@ -59,6 +59,43 @@ async def test_hmip_switch(hass, default_mock_hap_factory): assert ha_state.state == STATE_ON +async def test_hmip_switch_input(hass, default_mock_hap_factory): + """Test HomematicipSwitch.""" + entity_id = "switch.wohnzimmer_beleuchtung" + entity_name = "Wohnzimmer Beleuchtung" + device_model = "HmIP-FSI16" + mock_hap = await default_mock_hap_factory.async_get_mock_hap( + test_devices=[entity_name] + ) + + ha_state, hmip_device = get_and_check_entity_basics( + hass, mock_hap, entity_id, entity_name, device_model + ) + + assert ha_state.state == STATE_ON + service_call_counter = len(hmip_device.mock_calls) + + await hass.services.async_call( + "switch", "turn_off", {"entity_id": entity_id}, blocking=True + ) + assert len(hmip_device.mock_calls) == service_call_counter + 1 + assert hmip_device.mock_calls[-1][0] == "turn_off" + assert hmip_device.mock_calls[-1][1] == () + await async_manipulate_test_data(hass, hmip_device, "on", False) + ha_state = hass.states.get(entity_id) + assert ha_state.state == STATE_OFF + + await hass.services.async_call( + "switch", "turn_on", {"entity_id": entity_id}, blocking=True + ) + assert len(hmip_device.mock_calls) == service_call_counter + 3 + assert hmip_device.mock_calls[-1][0] == "turn_on" + assert hmip_device.mock_calls[-1][1] == () + await async_manipulate_test_data(hass, hmip_device, "on", True) + ha_state = hass.states.get(entity_id) + assert ha_state.state == STATE_ON + + async def test_hmip_switch_measuring(hass, default_mock_hap_factory): """Test HomematicipSwitchMeasuring.""" entity_id = "switch.pc"