@@ -229,3 +229,30 @@ class MatterSoftwareVersion:
229
229
min_applicable_software_version : int
230
230
max_applicable_software_version : int
231
231
release_notes_url : str | None
232
+
233
+ @classmethod
234
+ def from_dict (cls , data : dict ) -> MatterSoftwareVersion :
235
+ """Initialize from dict."""
236
+ return cls (
237
+ vid = data ["vid" ],
238
+ pid = data ["pid" ],
239
+ software_version = data ["software_version" ],
240
+ software_version_string = data ["software_version_string" ],
241
+ firmware_information = data ["firmware_information" ],
242
+ min_applicable_software_version = data ["min_applicable_software_version" ],
243
+ max_applicable_software_version = data ["max_applicable_software_version" ],
244
+ release_notes_url = data ["release_notes_url" ],
245
+ )
246
+
247
+ def as_dict (self ) -> dict :
248
+ """Return dict representation of the object."""
249
+ return {
250
+ "vid" : self .vid ,
251
+ "pid" : self .pid ,
252
+ "software_version" : self .software_version ,
253
+ "software_version_string" : self .software_version_string ,
254
+ "firmware_information" : self .firmware_information ,
255
+ "min_applicable_software_version" : self .min_applicable_software_version ,
256
+ "max_applicable_software_version" : self .max_applicable_software_version ,
257
+ "release_notes_url" : self .release_notes_url ,
258
+ }
0 commit comments