@@ -133,6 +133,22 @@ class VoiceAssistantSubscriptionFlag(enum.IntFlag):
133
133
API_AUDIO = 1 << 2
134
134
135
135
136
+ class SubDeviceInfo (APIModelBase ):
137
+ id : str = ""
138
+ name : str = ""
139
+ suggested_area : str = ""
140
+
141
+ @classmethod
142
+ def convert_list (cls , value : list [Any ]) -> list [SubDeviceInfo ]:
143
+ ret = []
144
+ for x in value :
145
+ if isinstance (x , dict ):
146
+ ret .append (SubDeviceInfo .from_dict (x ))
147
+ else :
148
+ ret .append (SubDeviceInfo .from_pb (x ))
149
+ return ret
150
+
151
+
136
152
@_frozen_dataclass_decorator
137
153
class DeviceInfo (APIModelBase ):
138
154
uses_password : bool = False
@@ -153,6 +169,7 @@ class DeviceInfo(APIModelBase):
153
169
bluetooth_proxy_feature_flags : int = 0
154
170
suggested_area : str = ""
155
171
bluetooth_mac_address : str = ""
172
+ sub_devices : list [SubDeviceInfo ] = converter_field (default_factory = list , converter = SubDeviceInfo .convert_list )
156
173
157
174
def bluetooth_proxy_feature_flags_compat (self , api_version : APIVersion ) -> int :
158
175
if api_version < APIVersion (1 , 9 ):
@@ -198,6 +215,8 @@ class EntityInfo(APIModelBase):
198
215
entity_category : EntityCategory | None = converter_field (
199
216
default = EntityCategory .NONE , converter = EntityCategory .convert
200
217
)
218
+ # # Is it ok to ad for the generic device info before all are added?
219
+ # device_id: str = ""
201
220
202
221
203
222
@_frozen_dataclass_decorator
@@ -210,6 +229,7 @@ class EntityState(APIModelBase):
210
229
class BinarySensorInfo (EntityInfo ):
211
230
device_class : str = ""
212
231
is_status_binary_sensor : bool = False
232
+ device_id : str = ""
213
233
214
234
215
235
@_frozen_dataclass_decorator
@@ -226,6 +246,7 @@ class CoverInfo(EntityInfo):
226
246
supports_position : bool = False
227
247
supports_tilt : bool = False
228
248
device_class : str = ""
249
+ device_id : str = ""
229
250
230
251
231
252
class LegacyCoverState (APIIntEnum ):
0 commit comments