@@ -47,6 +47,8 @@ class APICommand(str, Enum):
47
47
PING_NODE = "ping_node"
48
48
GET_NODE_IP_ADDRESSES = "get_node_ip_addresses"
49
49
IMPORT_TEST_NODE = "import_test_node"
50
+ CHECK_NODE_UPDATE = "check_node_update"
51
+ UPDATE_NODE = "update_node"
50
52
51
53
52
54
EventCallBackType = Callable [[EventType , Any ], None ]
@@ -209,3 +211,59 @@ class CommissioningParameters:
209
211
setup_pin_code : int
210
212
setup_manual_code : str
211
213
setup_qr_code : str
214
+
215
+
216
+ class UpdateSource (Enum ):
217
+ """Enum with possible sources for a software update."""
218
+
219
+ MAIN_NET_DCL = "main-net-dcl"
220
+ TEST_NET_DCL = "test-net-dcl"
221
+ LOCAL = "local"
222
+
223
+
224
+ @dataclass
225
+ class MatterSoftwareVersion :
226
+ """Representation of a Matter software version. Return by the check_node_update command.
227
+
228
+ This holds Matter software version information similar to what is available from the CSA DCL.
229
+ https://on.dcl.csa-iot.org/#/Query/ModelVersion.
230
+ """
231
+
232
+ vid : int
233
+ pid : int
234
+ software_version : int
235
+ software_version_string : str
236
+ firmware_information : str | None
237
+ min_applicable_software_version : int
238
+ max_applicable_software_version : int
239
+ release_notes_url : str | None
240
+ update_source : UpdateSource
241
+
242
+ @classmethod
243
+ def from_dict (cls , data : dict ) -> MatterSoftwareVersion :
244
+ """Initialize from dict."""
245
+ return cls (
246
+ vid = data ["vid" ],
247
+ pid = data ["pid" ],
248
+ software_version = data ["software_version" ],
249
+ software_version_string = data ["software_version_string" ],
250
+ firmware_information = data ["firmware_information" ],
251
+ min_applicable_software_version = data ["min_applicable_software_version" ],
252
+ max_applicable_software_version = data ["max_applicable_software_version" ],
253
+ release_notes_url = data ["release_notes_url" ],
254
+ update_source = UpdateSource (data ["update_source" ]),
255
+ )
256
+
257
+ def as_dict (self ) -> dict :
258
+ """Return dict representation of the object."""
259
+ return {
260
+ "vid" : self .vid ,
261
+ "pid" : self .pid ,
262
+ "software_version" : self .software_version ,
263
+ "software_version_string" : self .software_version_string ,
264
+ "firmware_information" : self .firmware_information ,
265
+ "min_applicable_software_version" : self .min_applicable_software_version ,
266
+ "max_applicable_software_version" : self .max_applicable_software_version ,
267
+ "release_notes_url" : self .release_notes_url ,
268
+ "update_source" : str (self .update_source ),
269
+ }
0 commit comments