Skip to content

Commit

Permalink
Automatically re-interview a node if its software version has changed (
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt authored Oct 25, 2023
1 parent d0cb830 commit 86af4c5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions matter_server/server/device_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,14 @@ def attribute_updated_callback(
)
return

# work out if software version changed
if (
path.AttributeType == Clusters.BasicInformation.softwareVersion
and new_value != old_value
):
# schedule a full interview of the node if the software version changed
self.server.loop.create_task(self.interview_node(node_id))

# store updated value in node attributes
node.attributes[attr_path] = new_value

Expand Down Expand Up @@ -811,8 +819,6 @@ def reschedule() -> None:
node_data is None
# re-interview if the schema has changed
or node_data.interview_version < SCHEMA_VERSION
# re-interview every 30 days
or (datetime.utcnow() - node_data.last_interview).days > 30
):
try:
await self.interview_node(node_id)
Expand Down

0 comments on commit 86af4c5

Please sign in to comment.