Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

Commit

Permalink
add translation_key
Browse files Browse the repository at this point in the history
set the translation_key on the selector select configuration
  • Loading branch information
dscao authored May 19, 2023
1 parent 3c265d8 commit 3215e4a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions custom_components/gooddriver/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import requests
import re
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.selector import SelectSelector, SelectSelectorConfig, SelectSelectorMode
from homeassistant.const import CONF_API_KEY, CONF_NAME

from collections import OrderedDict
Expand All @@ -31,11 +32,6 @@

_LOGGER = logging.getLogger(__name__)


SENSOR_LIST = {
KEY_PARKING_TIME: "parkingtime"
}

@config_entries.HANDLERS.register(DOMAIN)
class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
@staticmethod
Expand Down Expand Up @@ -148,7 +144,14 @@ async def async_step_user(self, user_input=None):
vol.Optional(CONF_UPDATE_INTERVAL, default=self.config_entry.options.get(CONF_UPDATE_INTERVAL, 90),): vol.All(vol.Coerce(int), vol.Range(min=10, max=3600)),
vol.Optional(CONF_GPS_CONVER, default=self.config_entry.options.get(CONF_GPS_CONVER, True),): bool,
vol.Optional(CONF_ATTR_SHOW, default=self.config_entry.options.get(CONF_ATTR_SHOW, True),): bool,
vol.Optional(CONF_SENSORS, default=self.config_entry.options.get(CONF_SENSORS)): cv.multi_select(SENSOR_LIST),
vol.Optional(CONF_SENSORS, default=self.config_entry.options.get(CONF_SENSORS)): SelectSelector(
SelectSelectorConfig(
options=[
{"value": KEY_PARKING_TIME, "label": "parkingtime"}
],
multiple=True,translation_key=CONF_SENSORS
)
)
}
),
)
Expand Down

0 comments on commit 3215e4a

Please sign in to comment.