From a0d8ff09581d9e4ed414e087e4e43624683806f7 Mon Sep 17 00:00:00 2001 From: Chris Date: Sat, 28 Jan 2023 14:05:23 -0700 Subject: [PATCH] fix: max_amps selector not always allowing last option --- custom_components/openevse/select.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/custom_components/openevse/select.py b/custom_components/openevse/select.py index 7dfec51..00693dc 100644 --- a/custom_components/openevse/select.py +++ b/custom_components/openevse/select.py @@ -88,6 +88,7 @@ async def async_select_option(self, option: Any) -> None: _LOGGER.debug("Command: %s", command) await send_command(charger, command) else: + _LOGGER.debug("Command: %s Option: %s", self._command, option) await getattr(self._manager, self._command)(option) except (ValueError, KeyError) as err: _LOGGER.warning( @@ -109,9 +110,8 @@ def get_options(self) -> list[str]: """Return a set of selectable options.""" if self._type == "max_current_soft": min = self.coordinator.data["min_amps"] - max = self.coordinator.data["max_amps"] - _LOGGER.debug( - "Max Amps: %s", list([str(item) for item in range(min, max + 1)]) - ) - return list([str(item) for item in range(min, max + 1)]) + max = self.coordinator.data["max_amps"] + 1 + options = list([str(item) for item in range(min, max)]) + _LOGGER.debug("Max Amps: %s", options) + return options return self._default_options