mirror of
https://github.com/esphome/aioesphomeapi.git
synced 2024-11-15 10:55:13 +01:00
Dataclasses better legacy UserService compat (#49)
This commit is contained in:
parent
be1a8e1691
commit
29b1902577
@ -485,9 +485,11 @@ class UserServiceArg(APIModelBase):
|
||||
ret = []
|
||||
for x in value:
|
||||
if isinstance(x, dict):
|
||||
ret.append(UserServiceArg(x["name"], x["type"]))
|
||||
if "type_" in x and "type" not in x:
|
||||
x = {**x, "type": x["type_"]}
|
||||
ret.append(UserServiceArg.from_dict(x))
|
||||
else:
|
||||
ret.append(UserServiceArg(x.name, x.type))
|
||||
ret.append(UserServiceArg.from_pb(x))
|
||||
return ret
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user