From 86af4c502977c72fe17178172921e9b14c510caa Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Wed, 25 Oct 2023 11:32:20 +0200 Subject: [PATCH] Automatically re-interview a node if its software version has changed (#417) --- matter_server/server/device_controller.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/matter_server/server/device_controller.py b/matter_server/server/device_controller.py index 98ba7567..1ef91639 100644 --- a/matter_server/server/device_controller.py +++ b/matter_server/server/device_controller.py @@ -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 @@ -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)