Skip to content

Commit

Permalink
Add api level lock
Browse files Browse the repository at this point in the history
  • Loading branch information
cyr-ius committed Jan 4, 2024
1 parent 6101a94 commit 6f6a281
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions custom_components/audiconnect/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
import logging
from typing import Any

from audiconnectpy import AudiConnect, AudiException, AuthorizationError
import voluptuous as vol

from audiconnectpy import AudiConnect, AudiException, AuthorizationError
from homeassistant import config_entries
from homeassistant.const import CONF_PASSWORD, CONF_PIN, CONF_USERNAME
from homeassistant.core import callback
Expand All @@ -20,7 +19,16 @@
SelectSelectorMode,
)

from .const import CONF_COUNTRY, COUNTRY_CODE, DOMAIN
from .const import (
API_LEVEL_CHARGER,
API_LEVEL_CLIMATISATION,
API_LEVEL_LOCK,
API_LEVEL_VENTILATION,
API_LEVEL_WINDOWSHEATING,
CONF_COUNTRY,
COUNTRY_CODE,
DOMAIN,
)

_LOGGER = logging.getLogger(__name__)

Expand All @@ -36,10 +44,6 @@

CONF_VEHICLE = "vehicle"
CONF_SAVE = "save"
API_LEVEL_CLIMATISATION = "api_level_climatisation"
API_LEVEL_VENTILATION = "api_level_ventilation"
API_LEVEL_CHARGER = "api_level_charger"
API_LEVEL_WINDOWSHEATING = "api_level_windows_heating"


class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
Expand Down Expand Up @@ -193,6 +197,15 @@ async def async_step_apilevel(self, user_input=None):
],
)
),
vol.Required(
API_LEVEL_LOCK,
default=api_level.get(API_LEVEL_LOCK, "1"),
): SelectSelector(
SelectSelectorConfig(
mode=SelectSelectorMode.DROPDOWN,
options=[SelectOptionDict(value="1", label="Level 1")],
)
),
}
)

Expand Down

0 comments on commit 6f6a281

Please sign in to comment.