Skip to content

Commit 2253921

Browse files
committed
Use safer dict key lookup
1 parent 787a188 commit 2253921

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

plugin/homeassistant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ class InputSelect(BaseEntity):
429429

430430
def __init__(self, client: Client, entity: dict) -> None:
431431
super().__init__(client, entity)
432-
for option in self.attributes["options"]:
432+
for option in self.attributes.get("options", []):
433433
setattr(self, option, partial(self._select, option))
434434
getattr(self, option).name = option
435435
getattr(self, option).__doc__ = 'Set option to "{}"'.format(option)

0 commit comments

Comments
 (0)