Add application credentials platform for nest and deprecate yaml for SDM API (#73050)

* Update the nest integration to be useable fully from the config flow

* Support discovery in nest config flow

* Remove configuration entries

* Remove unused import

* Remove dead code

* Update homeassistant/components/nest/strings.json

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Remove commented out code

* Use config flow for app auth reauthentication path

* Improves for re-auth for upgrading existing project and creds

* More dead code removal

* Apply suggestions from code review

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Remove outdated code

* Update homeassistant/components/nest/config_flow.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Allen Porter 2022-06-15 07:15:53 -07:00 committed by GitHub
parent f8f1bfde21
commit b014d558ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 856 additions and 517 deletions

View file

@ -11,6 +11,8 @@ The tests below exercise both cases during integration setup.
import time
from unittest.mock import patch
import pytest
from homeassistant.components.nest import DOMAIN
from homeassistant.components.nest.const import API_URL, OAUTH2_TOKEN, SDM_SCOPES
from homeassistant.setup import async_setup_component
@ -23,6 +25,7 @@ from .common import (
FAKE_REFRESH_TOKEN,
FAKE_TOKEN,
PROJECT_ID,
TEST_CONFIGFLOW_YAML_ONLY,
create_config_entry,
)
@ -35,6 +38,7 @@ async def async_setup_sdm(hass):
await hass.async_block_till_done()
@pytest.mark.parametrize("nest_test_config", [TEST_CONFIGFLOW_YAML_ONLY])
async def test_auth(hass, aioclient_mock):
"""Exercise authentication library creates valid credentials."""
@ -84,6 +88,7 @@ async def test_auth(hass, aioclient_mock):
assert creds.scopes == SDM_SCOPES
@pytest.mark.parametrize("nest_test_config", [TEST_CONFIGFLOW_YAML_ONLY])
async def test_auth_expired_token(hass, aioclient_mock):
"""Verify behavior of an expired token."""