"""Constants for Renault API."""

CONF_COUNTRY = "country"
CONF_LOCALE = "locale"
CONF_GIGYA_APIKEY = "gigya-api-key"
CONF_GIGYA_URL = "gigya-root-url"
CONF_KAMEREON_APIKEY = "kamereon-api-key"
CONF_KAMEREON_URL = "kamereon-root-url"

PERMANENT_KEYS = [
    CONF_COUNTRY,
    CONF_LOCALE,
    CONF_GIGYA_APIKEY,
    CONF_GIGYA_URL,
    CONF_KAMEREON_APIKEY,
    CONF_KAMEREON_URL,
]


GIGYA_KEY_EU = "3_VgdkgtIRH3AdHvJm-cjV2ug2EFE0lxt0IJzMC4MFqZjFpn_GYFXVdNZ19L7wZX0N"
GIGYA_URL_EU = "https://accounts.eu1.gigya.com"
GIGYA_URL_US = "https://accounts.us1.gigya.com"
KAMEREON_APIKEY = "YjkKtHmGfaceeuExUDKGxrLZGGvtVS0J"
KAMEREON_URL_EU = "https://api-wired-prod-1-euw1.wrd-aws.com"
KAMEREON_URL_US = "https://api-wired-prod-1-usw2.wrd-aws.com"

LOCALE_BASE_URL = (
    "https://renault-wrd-prod-1-euw1-myrapp-one.s3-eu-west-1.amazonaws.com"
)

AVAILABLE_LOCALES = {
    "bg_BG": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "cs_CZ": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "da_DK": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "de_DE": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "de_AT": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "de_CH": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "en_GB": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "en_IE": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "es_ES": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "es_MX": {
        CONF_GIGYA_URL: GIGYA_URL_US,
        CONF_GIGYA_APIKEY: "4_yTFqPSsGxVyRXPZUM7t1Iw",  # noqa
        CONF_KAMEREON_URL: KAMEREON_URL_US,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "fi_FI": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "fr_FR": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "fr_BE": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "fr_CH": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "fr_LU": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: "3_zt44Wl_wT9mnqn-BHrR19PvXj3wYRPQKLcPbGWawlatFR837KdxSZZStbBTDaqnb",  # noqa
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "hr_HR": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "hu_HU": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "it_IT": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "it_CH": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "nl_NL": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "nl_BE": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "no_NO": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "pl_PL": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "pt_PT": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "ro_RO": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "ru_RU": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "sk_SK": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "sl_SI": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
    "sv_SE": {
        CONF_GIGYA_URL: GIGYA_URL_EU,
        CONF_GIGYA_APIKEY: GIGYA_KEY_EU,
        CONF_KAMEREON_URL: KAMEREON_URL_EU,
        CONF_KAMEREON_APIKEY: KAMEREON_APIKEY,
    },
}

# SoC level boundaries (to comply with mobile apps contraints and to
# balance poor Renault API checks)
MIN_SOC_MIN = 15
MAX_SOC_MIN = 45
MIN_SOC_TARGET = 55
MAX_SOC_TARGET = 100
SOC_STEP = 5
