Skip to content

Commit eba1724

Browse files
committed
Get updated attribute values
Make sure to get the attribute values again after each command to get the updated attribute cache.
1 parent b02ee8e commit eba1724

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/controller/python/test/test_scripts/cluster_objects.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,12 @@ def subUpdate(path: TypedAttributePath, transaction: SubscriptionTransaction):
216216
sub.SetAttributeUpdateCallback(subUpdate)
217217

218218
try:
219-
data = sub.GetAttributes()
220219
req = Clusters.OnOff.Commands.On()
221220
await devCtrl.SendCommand(nodeid=NODE_ID, endpoint=1, payload=req)
222221

223222
await asyncio.wait_for(event.wait(), timeout=11)
224223

224+
data = sub.GetAttributes()
225225
if (data[1][Clusters.OnOff][Clusters.OnOff.Attributes.OnOff] != 1):
226226
raise ValueError("Current On/Off state should be 1")
227227

@@ -232,6 +232,7 @@ def subUpdate(path: TypedAttributePath, transaction: SubscriptionTransaction):
232232

233233
await asyncio.wait_for(event.wait(), timeout=11)
234234

235+
data = sub.GetAttributes()
235236
if (data[1][Clusters.OnOff][Clusters.OnOff.Attributes.OnOff] != 0):
236237
raise ValueError("Current On/Off state should be 0")
237238

0 commit comments

Comments
 (0)