Improve Advantage Air integration to Platinum quality (#41996)

* Rename to ADVANTAGE_AIR_DOMAIN

* Remove attributes from binary sensor platform

* Handle other motionConfig values

* Restructure

* Unloading

* Fix unloading

* PARALLEL_UPDATES

* Remove pointless check

* Rollup to sensor

* Rollup to switch platform

* @ctalkington suggestion of added __init__ back

* Fix unload test

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Fix ENTRY_STATE_NOT_LOADED

* Update test docstring

* Remove obsolete __init__'s

Co-authored-by: Chris Talkington <chris@talkingtontech.com>

* Remove unused __init__ from cover

* Code Quality 🏆 Platinum

* Re-push manifest.json

Co-authored-by: Chris Talkington <chris@talkingtontech.com>
This commit is contained in:
BrettandChris Talkington authored and GitHub committed 2020-10-20 13:30:09 -05:00
1 parent 023268df38
commit 582074d1db
9 files changed
+110 -83

No files matched your search

+10 -2
View File
@@ -1,6 +1,10 @@
"""Test the Advantage Air Initialization."""
from homeassistant.config_entries import ENTRY_STATE_LOADED, ENTRY_STATE_SETUP_RETRY
from homeassistant.config_entries import (
ENTRY_STATE_LOADED,
ENTRY_STATE_NOT_LOADED,
ENTRY_STATE_SETUP_RETRY,
)
from tests.components.advantage_air import (
TEST_SYSTEM_DATA,
@@ -10,7 +14,7 @@ from tests.components.advantage_air import (
async def test_async_setup_entry(hass, aioclient_mock):
"""Test a successful setup entry."""
"""Test a successful setup entry and unload."""
aioclient_mock.get(
TEST_SYSTEM_URL,
@@ -20,6 +24,10 @@ async def test_async_setup_entry(hass, aioclient_mock):
entry = await add_mock_config(hass)
assert entry.state == ENTRY_STATE_LOADED
assert await hass.config_entries.async_unload(entry.entry_id)
await hass.async_block_till_done()
assert entry.state == ENTRY_STATE_NOT_LOADED
async def test_async_setup_entry_failure(hass, aioclient_mock):
"""Test a unsuccessful setup entry."""