Add scopes in config flow auth request for Volvo integration (#149813)

This commit is contained in:
Thomas D 2025-08-02 22:17:13 +02:00 committed by GitHub
parent 755864f9f3
commit 72d9dbf39d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -9,6 +9,7 @@ from typing import Any
import voluptuous as vol import voluptuous as vol
from volvocarsapi.api import VolvoCarsApi from volvocarsapi.api import VolvoCarsApi
from volvocarsapi.models import VolvoApiException, VolvoCarsVehicle from volvocarsapi.models import VolvoApiException, VolvoCarsVehicle
from volvocarsapi.scopes import DEFAULT_SCOPES
from homeassistant.config_entries import ( from homeassistant.config_entries import (
SOURCE_REAUTH, SOURCE_REAUTH,
@ -54,6 +55,13 @@ class VolvoOAuth2FlowHandler(AbstractOAuth2FlowHandler, domain=DOMAIN):
self._vehicles: list[VolvoCarsVehicle] = [] self._vehicles: list[VolvoCarsVehicle] = []
self._config_data: dict = {} self._config_data: dict = {}
@property
def extra_authorize_data(self) -> dict:
"""Extra data that needs to be appended to the authorize url."""
return super().extra_authorize_data | {
"scope": " ".join(DEFAULT_SCOPES),
}
@property @property
def logger(self) -> logging.Logger: def logger(self) -> logging.Logger:
"""Return logger.""" """Return logger."""