Fix some small bugs

This commit is contained in:
Andre Basche
2023-07-10 00:21:45 +02:00
parent bb700dd2f7
commit c0d25a4efe
4 changed files with 11 additions and 17 deletions

View File

@ -199,9 +199,11 @@ class HonConfigSelectEntity(HonEntity, SelectEntity):
def _option_to_number(self, option: str, values: List[str]):
if (options := self.entity_description.option_list) is not None:
return next(
(k for k, v in options.items() if str(k) in values and v == option),
option,
return str(
next(
(k for k, v in options.items() if str(k) in values and v == option),
option,
)
)
return option