Skip to content

Commit eec94fe

Browse files
committed
Update Python controller bindings with latest patches
Add patches from upstream master branch which improve the Python controller bindings. Notable this makes use of more asyncio calls in the SDK stack, updates some defines around logging, drops unnecessary and obsolete logging code, and removes quite some unnecessary code in general.
1 parent 72ad04c commit eec94fe

17 files changed

+5510
-40
lines changed

0001-Support-custom-platform-tag.patch

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
From d06671d9031156ce3b29e06d7edb344d8f6ee0d6 Mon Sep 17 00:00:00 2001
2-
Message-ID: <d06671d9031156ce3b29e06d7edb344d8f6ee0d6.1698087175.git.stefan@agner.ch>
1+
From bcd84a21c67a681fcaba43118d9d9bb7ed618b55 Mon Sep 17 00:00:00 2001
32
From: Stefan Agner <stefan@agner.ch>
43
Date: Tue, 22 Nov 2022 10:51:17 +0100
54
Subject: [PATCH] Support custom platform tag
@@ -9,7 +8,7 @@ Subject: [PATCH] Support custom platform tag
98
1 file changed, 10 insertions(+), 10 deletions(-)
109

1110
diff --git a/src/controller/python/BUILD.gn b/src/controller/python/BUILD.gn
12-
index 4b84c63d5f..b01dafbc30 100644
11+
index 5fc2212098..caa33c3a40 100644
1312
--- a/src/controller/python/BUILD.gn
1413
+++ b/src/controller/python/BUILD.gn
1514
@@ -35,6 +35,15 @@ declare_args() {
@@ -28,7 +27,7 @@ index 4b84c63d5f..b01dafbc30 100644
2827
}
2928

3029
shared_library("ChipDeviceCtrl") {
31-
@@ -340,16 +349,7 @@ chip_python_wheel_action("chip-core") {
30+
@@ -344,16 +353,7 @@ chip_python_wheel_action("chip-core") {
3231
cpu_tag = current_cpu
3332
}
3433

@@ -47,5 +46,5 @@ index 4b84c63d5f..b01dafbc30 100644
4746
tags = "cp37-abi3-" + py_platform_tag
4847

4948
--
50-
2.42.0
49+
2.45.2
5150

0002-Use-data-as-platform-storage-location.patch

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
From 88ba0f8233f97a9bb773341da7c996deee9675fe Mon Sep 17 00:00:00 2001
2-
Message-ID: <88ba0f8233f97a9bb773341da7c996deee9675fe.1698087175.git.stefan@agner.ch>
3-
In-Reply-To: <d06671d9031156ce3b29e06d7edb344d8f6ee0d6.1698087175.git.stefan@agner.ch>
4-
References: <d06671d9031156ce3b29e06d7edb344d8f6ee0d6.1698087175.git.stefan@agner.ch>
1+
From 5c1316070604e8e7ade9b518ad717c63276dd06a Mon Sep 17 00:00:00 2001
52
From: Stefan Agner <stefan@agner.ch>
63
Date: Fri, 27 May 2022 16:38:14 +0200
74
Subject: [PATCH] Use /data as platform storage location
@@ -11,7 +8,7 @@ Subject: [PATCH] Use /data as platform storage location
118
1 file changed, 6 insertions(+)
129

1310
diff --git a/src/platform/Linux/BUILD.gn b/src/platform/Linux/BUILD.gn
14-
index a2cfa6b39c..f6fd74ab0c 100644
11+
index d73a2dcb0f..97c397994e 100644
1512
--- a/src/platform/Linux/BUILD.gn
1613
+++ b/src/platform/Linux/BUILD.gn
1714
@@ -38,6 +38,12 @@ if (chip_mdns == "platform") {
@@ -28,5 +25,5 @@ index a2cfa6b39c..f6fd74ab0c 100644
2825
"../DeviceSafeQueue.cpp",
2926
"../DeviceSafeQueue.h",
3027
--
31-
2.42.0
28+
2.45.2
3229

0003-Linux-Increase-number-of-endpoints.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 47ca82473af8d77eb89732884542c719ccdd9312 Mon Sep 17 00:00:00 2001
1+
From 3bcfcd1d91050868d0153bf7692db3ac844ccc94 Mon Sep 17 00:00:00 2001
22
From: Stefan Agner <stefan@agner.ch>
33
Date: Thu, 29 Feb 2024 19:07:15 +0100
44
Subject: [PATCH] Linux: Increase number of endpoints
@@ -36,5 +36,5 @@ index 3aab9a7b9b..02e664eddc 100644
3636

3737
// On linux platform, we have sys/socket.h, so HAVE_SO_BINDTODEVICE should be set to 1
3838
--
39-
2.44.0
39+
2.45.2
4040

0004-Python-Implement-async-friendly-GetConnectedDevice.patch 0004-Implement-async-friendly-GetConnectedDevice.patch

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From f9fc067ad51d3989a2045f19fc5641971ce1ee20 Mon Sep 17 00:00:00 2001
1+
From 7ce75765081aeebef5f3adc397dff4db256348eb Mon Sep 17 00:00:00 2001
22
From: Stefan Agner <stefan@agner.ch>
33
Date: Wed, 27 Mar 2024 22:13:19 +0100
4-
Subject: [PATCH] [Python] Implement async friendly GetConnectedDevice
4+
Subject: [PATCH] Implement async friendly GetConnectedDevice
55

66
Currently GetConnectedDeviceSync() is blocking e.g. when a new session
77
needs to be created. This is not asyncio friendly as it blocks the
@@ -129,5 +129,5 @@ index 369260787d..b3d0aa2d7f 100644
129129
v) for v in attributes] if attributes else None
130130
clusterDataVersionFilters = [self._parseDataVersionFilterTuple(
131131
--
132-
2.44.0
132+
2.45.2
133133

0005-Enable-node-ID-logging-in-exchanges.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From 3c551b7a706428d2fde77df0bc93d81bb37a2022 Mon Sep 17 00:00:00 2001
1+
From c1536db9448763f2e45b3aeef34f30cbfb41889e Mon Sep 17 00:00:00 2001
22
From: Stefan Agner <stefan@agner.ch>
33
Date: Thu, 18 Apr 2024 21:46:59 +0200
44
Subject: [PATCH] Enable node ID logging in exchanges
@@ -22,5 +22,5 @@ index 558e0ee08e..5a3f5facb7 100644
2222

2323
/**
2424
--
25-
2.44.0
25+
2.45.2
2626

0001-Python-Fix-OnRead-Event-Attribute-DataCallback-for-A.patch 0006-Fix-OnRead-Event-Attribute-DataCallback-for-Arm64-Ap.patch

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
From dce7020f3a9e542e6afbc59f131c77210df5f7db Mon Sep 17 00:00:00 2001
2-
Message-ID: <dce7020f3a9e542e6afbc59f131c77210df5f7db.1714067071.git.stefan@agner.ch>
1+
From 113143a945bbe5663b78b59b05d6b00670d79292 Mon Sep 17 00:00:00 2001
32
From: Stefan Agner <stefan@agner.ch>
43
Date: Thu, 25 Apr 2024 15:19:17 +0200
5-
Subject: [PATCH] [Python] Fix OnRead[Event|Attribute]DataCallback for Arm64
6-
Apple Patform devices
4+
Subject: [PATCH] Fix OnRead[Event|Attribute]DataCallback for Arm64 Apple
5+
Patform devices
76

87
On M1/Arm64 macOS systems, the OnReadEventDataCallback often returned
98
an invalid status, e.g.:
@@ -50,5 +49,5 @@ index e31f3431b8..b73b4a49b4 100644
5049
// When the apData is nullptr, means we did not receive a valid event data from server, status will be some error
5150
// status.
5251
--
53-
2.44.0
52+
2.45.2
5453

0006-Python-Add-raw-attribute-callback.patch 0007-Add-raw-attribute-callback.patch

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
From 9bc05af1e1ef2ec93336dc0eecba16b6802b6fb1 Mon Sep 17 00:00:00 2001
2-
Message-ID: <9bc05af1e1ef2ec93336dc0eecba16b6802b6fb1.1716466458.git.stefan@agner.ch>
1+
From 4fe4daf7f165dc007ab6092bee2adef67650d129 Mon Sep 17 00:00:00 2001
32
From: Stefan Agner <stefan@agner.ch>
43
Date: Thu, 23 May 2024 12:48:54 +0200
5-
Subject: [PATCH] [Python] Add raw attribute callback
4+
Subject: [PATCH] Add raw attribute callback
65

76
Add new subscription callback which uses raw AttributePath as paths
87
of changed attributes. This allows to subscribe to custom clusters,
@@ -102,5 +101,5 @@ index 9e46eed469..ce522bf452 100644
102101
# Clear it out once we've notified of all changes in this transaction.
103102
self._changedPathSet = set()
104103
--
105-
2.45.1
104+
2.45.2
106105

0 commit comments

Comments
 (0)