1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 04:50:05 +00:00

Replace abodepy library with jaraco.abode to enable new Abode devices (#85474)

* replaced abodepy library with jaraco.abode

* updated jaraco.abode to version 3.2.1

* send capture event as dict
This commit is contained in:
Todd Radel
2023-01-24 06:44:38 -05:00
committed by GitHub
parent 66f12d7dab
commit 63bddae01d
24 changed files with 118 additions and 114 deletions

View File

@@ -2,8 +2,10 @@
from http import HTTPStatus
from unittest.mock import patch
from abodepy.exceptions import AbodeAuthenticationException
from abodepy.helpers.errors import MFA_CODE_REQUIRED
from jaraco.abode.exceptions import (
AuthenticationException as AbodeAuthenticationException,
)
from jaraco.abode.helpers.errors import MFA_CODE_REQUIRED
from requests.exceptions import ConnectTimeout
from homeassistant import data_entry_flow
@@ -96,9 +98,7 @@ async def test_step_user(hass: HomeAssistant) -> None:
"""Test that the user step works."""
conf = {CONF_USERNAME: "user@email.com", CONF_PASSWORD: "password"}
with patch("homeassistant.components.abode.config_flow.Abode"), patch(
"abodepy.UTILS"
):
with patch("homeassistant.components.abode.config_flow.Abode"):
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": SOURCE_USER}, data=conf
@@ -140,9 +140,7 @@ async def test_step_mfa(hass: HomeAssistant) -> None:
assert result["errors"] == {"base": "invalid_mfa_code"}
with patch("homeassistant.components.abode.config_flow.Abode"), patch(
"abodepy.UTILS"
):
with patch("homeassistant.components.abode.config_flow.Abode"):
result = await hass.config_entries.flow.async_configure(
result["flow_id"], user_input={"mfa_code": "123456"}
)
@@ -166,9 +164,7 @@ async def test_step_reauth(hass: HomeAssistant) -> None:
data=conf,
).add_to_hass(hass)
with patch("homeassistant.components.abode.config_flow.Abode"), patch(
"abodepy.UTILS"
):
with patch("homeassistant.components.abode.config_flow.Abode"):
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={"source": SOURCE_REAUTH},