mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
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@0b61954f6a Closes: #20428
This commit is contained in:
parent
df8589c36a
commit
fe4a2b5b31
@ -39,8 +39,7 @@ class HomematicipAuth:
|
|||||||
from homematicip.base.base_connection import HmipConnectionError
|
from homematicip.base.base_connection import HmipConnectionError
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await self.auth.isRequestAcknowledged()
|
return await self.auth.isRequestAcknowledged()
|
||||||
return True
|
|
||||||
except HmipConnectionError:
|
except HmipConnectionError:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ async def test_auth_auth_check_and_register(hass):
|
|||||||
hap = hmipc.HomematicipAuth(hass, config)
|
hap = hmipc.HomematicipAuth(hass, config)
|
||||||
hap.auth = Mock()
|
hap.auth = Mock()
|
||||||
with patch.object(hap.auth, 'isRequestAcknowledged',
|
with patch.object(hap.auth, 'isRequestAcknowledged',
|
||||||
return_value=mock_coro()), \
|
return_value=mock_coro(True)), \
|
||||||
patch.object(hap.auth, 'requestAuthToken',
|
patch.object(hap.auth, 'requestAuthToken',
|
||||||
return_value=mock_coro('ABC')), \
|
return_value=mock_coro('ABC')), \
|
||||||
patch.object(hap.auth, 'confirmAuthToken',
|
patch.object(hap.auth, 'confirmAuthToken',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user