Rewrite Atag (#35496)

* rewrite library

* Update strings.json

* fix updated with empty reply

* dont use entity_id

* atag_id

* use super init instead

* original ids to prevent breaking change
This commit is contained in:
MatsNl authored and GitHub committed 2020-05-12 11:47:33 +02:00
1 parent 86b984b0bd
commit 4099815a08
10 files changed
+112 -173

No files matched your search

+6 -5
View File
@@ -3,13 +3,14 @@ from pyatag import AtagException
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.atag import DOMAIN
from homeassistant.const import CONF_DEVICE, CONF_HOST, CONF_PORT
from homeassistant.const import CONF_DEVICE, CONF_EMAIL, CONF_HOST, CONF_PORT
from tests.async_mock import PropertyMock, patch
from tests.common import MockConfigEntry
FIXTURE_USER_INPUT = {
CONF_HOST: "127.0.0.1",
CONF_EMAIL: "test@domain.com",
CONF_PORT: 10000,
}
FIXTURE_COMPLETE_ENTRY = FIXTURE_USER_INPUT.copy()
@@ -42,7 +43,7 @@ async def test_connection_error(hass):
"""Test we show user form on Atag connection error."""
with patch(
"homeassistant.components.atag.config_flow.AtagDataStore.async_check_pair_status",
"homeassistant.components.atag.config_flow.AtagOne.authorize",
side_effect=AtagException(),
):
result = await hass.config_entries.flow.async_init(
@@ -58,10 +59,10 @@ async def test_connection_error(hass):
async def test_full_flow_implementation(hass):
"""Test registering an integration and finishing flow works."""
with patch(
"homeassistant.components.atag.AtagDataStore.async_check_pair_status",
with patch("homeassistant.components.atag.AtagOne.authorize",), patch(
"homeassistant.components.atag.AtagOne.update",
), patch(
"homeassistant.components.atag.AtagDataStore.device",
"homeassistant.components.atag.AtagOne.id",
new_callable=PropertyMock(return_value="device_identifier"),
):
result = await hass.config_entries.flow.async_init(