Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
This commit is contained in:
Daniel Hjelseth Høyer
2025-11-27 18:54:32 +01:00
parent 45ddbb6ab8
commit 2b898d2eab
3 changed files with 5 additions and 5 deletions

View File

@@ -24,7 +24,7 @@ from homeassistant.helpers.config_entry_oauth2_flow import (
from homeassistant.helpers.typing import ConfigType
from homeassistant.util import dt as dt_util, ssl as ssl_util
from .const import DATA_HASS_CONFIG, DOMAIN
from .const import AUTH_IMPLEMENTATION, DATA_HASS_CONFIG, DOMAIN
from .services import async_setup_services
PLATFORMS = [Platform.NOTIFY, Platform.SENSOR]
@@ -75,7 +75,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up a config entry."""
if "auth_implementation" not in entry.data:
if AUTH_IMPLEMENTATION not in entry.data:
entry.async_start_reauth(hass)
raise ConfigEntryAuthFailed(
translation_domain=DOMAIN,

View File

@@ -11,7 +11,7 @@ from homeassistant.components.application_credentials import (
async_import_client_credential,
)
from homeassistant.components.recorder import Recorder
from homeassistant.components.tibber.const import DOMAIN
from homeassistant.components.tibber.const import AUTH_IMPLEMENTATION, DOMAIN
from homeassistant.const import CONF_ACCESS_TOKEN
from homeassistant.core import HomeAssistant
from homeassistant.setup import async_setup_component
@@ -62,7 +62,7 @@ def config_entry(hass: HomeAssistant) -> MockConfigEntry:
domain=DOMAIN,
data={
CONF_ACCESS_TOKEN: "token",
"auth_implementation": DOMAIN,
AUTH_IMPLEMENTATION: DOMAIN,
},
unique_id="tibber",
)

View File

@@ -200,7 +200,7 @@ async def test_full_flow_success(
data = result["data"]
assert data[CONF_TOKEN]["access_token"] == "mock-access-token"
assert data[CONF_ACCESS_TOKEN] == "graphql-token"
assert data["auth_implementation"] == DOMAIN
assert data[AUTH_IMPLEMENTATION] == DOMAIN
assert result["title"] == "Mock Name"