From fe4a2b5b31c6943dc6561d80c1f94a50a9b61372 Mon Sep 17 00:00:00 2001 From: Johann Bauer Date: Tue, 19 Feb 2019 18:53:20 +0100 Subject: [PATCH] Fix Homematic IP Cloud configuration (#21202) `homematicip.aio.auth.isRequestAcknowledged` returns false if the request failed in stead of raising an error. See coreGreenberet/homematicip-rest-api@0b61954f6accf773a32cf91772b0a5b1bb7ef4ac Closes: #20428 --- homeassistant/components/homematicip_cloud/hap.py | 3 +-- tests/components/homematicip_cloud/test_hap.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/homematicip_cloud/hap.py b/homeassistant/components/homematicip_cloud/hap.py index 4acace4a8b1..64721c0a96c 100644 --- a/homeassistant/components/homematicip_cloud/hap.py +++ b/homeassistant/components/homematicip_cloud/hap.py @@ -39,8 +39,7 @@ class HomematicipAuth: from homematicip.base.base_connection import HmipConnectionError try: - await self.auth.isRequestAcknowledged() - return True + return await self.auth.isRequestAcknowledged() except HmipConnectionError: return False diff --git a/tests/components/homematicip_cloud/test_hap.py b/tests/components/homematicip_cloud/test_hap.py index c39e7d4e26b..61ca3300d60 100644 --- a/tests/components/homematicip_cloud/test_hap.py +++ b/tests/components/homematicip_cloud/test_hap.py @@ -44,7 +44,7 @@ async def test_auth_auth_check_and_register(hass): hap = hmipc.HomematicipAuth(hass, config) hap.auth = Mock() with patch.object(hap.auth, 'isRequestAcknowledged', - return_value=mock_coro()), \ + return_value=mock_coro(True)), \ patch.object(hap.auth, 'requestAuthToken', return_value=mock_coro('ABC')), \ patch.object(hap.auth, 'confirmAuthToken',