diff --git a/custom_components/gooddriver/config_flow.py b/custom_components/gooddriver/config_flow.py index a7cbfe1..6389ea1 100644 --- a/custom_components/gooddriver/config_flow.py +++ b/custom_components/gooddriver/config_flow.py @@ -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 @@ -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 @@ -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 + ) + ) } ), )