Skip to content

Commit 116077d

Browse files
committedJul 11, 2024
Add client commands for updates
Add two new client commands to check for updates and trigger the update.
1 parent e1a5941 commit 116077d

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
 

‎matter_server/client/client.py

+20
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,26 @@ async def interview_node(self, node_id: int) -> None:
509509
"""Interview a node."""
510510
await self.send_command(APICommand.INTERVIEW_NODE, node_id=node_id)
511511

512+
async def check_node_update(self, node_id: int) -> dict[str, Any]:
513+
"""Check Node for updates.
514+
515+
Return a dict with the available update information. Most notable
516+
"softwareVersion" contains the integer value of the update version which then
517+
can be used for the update_node command to trigger the update.
518+
519+
The "softwareVersionString" is a human friendly version string.
520+
"""
521+
node_update = await self.send_command(
522+
APICommand.CHECK_NODE_UPDATE, node_id=node_id
523+
)
524+
return cast(dict[str, Any], node_update)
525+
526+
async def update_node(self, node_id: int, software_version: int) -> None:
527+
"""Start node update to a particular version."""
528+
await self.send_command(
529+
APICommand.UPDATE_NODE, node_id=node_id, software_version=software_version
530+
)
531+
512532
def _prepare_message(
513533
self,
514534
command: str,

0 commit comments

Comments
 (0)