File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -228,6 +228,8 @@ class MiotProperty(MiotBaseModel):
228228 choices : Optional [list [MiotEnumValue ]] = Field (alias = "value-list" )
229229 gatt_access : Optional [list [Any ]] = Field (alias = "gatt-access" )
230230
231+ source : Optional [int ] = None
232+
231233 # TODO: currently just used to pass the data for miiocli
232234 # there must be a better way to do this..
233235 value : Optional [Any ] = None
@@ -238,7 +240,10 @@ def pretty_value(self):
238240
239241 if self .choices is not None :
240242 # TODO: find a nicer way to get the choice by value
241- selected = next (c .description for c in self .choices if c .value == value )
243+ selected = next (
244+ (c .description for c in self .choices if c .value == value ),
245+ self .choices [0 ],
246+ )
242247 current = f"{ selected } (value: { value } )"
243248 return current
244249
You can’t perform that action at this time.
0 commit comments