@@ -216,12 +216,12 @@ def subUpdate(path: TypedAttributePath, transaction: SubscriptionTransaction):
216
216
sub .SetAttributeUpdateCallback (subUpdate )
217
217
218
218
try :
219
- data = sub .GetAttributes ()
220
219
req = Clusters .OnOff .Commands .On ()
221
220
await devCtrl .SendCommand (nodeid = NODE_ID , endpoint = 1 , payload = req )
222
221
223
222
await asyncio .wait_for (event .wait (), timeout = 11 )
224
223
224
+ data = sub .GetAttributes ()
225
225
if (data [1 ][Clusters .OnOff ][Clusters .OnOff .Attributes .OnOff ] != 1 ):
226
226
raise ValueError ("Current On/Off state should be 1" )
227
227
@@ -232,6 +232,7 @@ def subUpdate(path: TypedAttributePath, transaction: SubscriptionTransaction):
232
232
233
233
await asyncio .wait_for (event .wait (), timeout = 11 )
234
234
235
+ data = sub .GetAttributes ()
235
236
if (data [1 ][Clusters .OnOff ][Clusters .OnOff .Attributes .OnOff ] != 0 ):
236
237
raise ValueError ("Current On/Off state should be 0" )
237
238
@@ -254,13 +255,12 @@ def subUpdate(path: TypedAttributePath, transaction: SubscriptionTransaction):
254
255
sub .SetAttributeUpdateCallback (subUpdate )
255
256
256
257
try :
257
- data = sub .GetAttributes ()
258
-
259
258
req = Clusters .OnOff .Commands .On ()
260
259
await devCtrl .SendCommand (nodeid = NODE_ID , endpoint = 1 , payload = req )
261
260
262
261
await asyncio .wait_for (event .wait (), timeout = 11 )
263
262
263
+ data = sub .GetAttributes ()
264
264
cluster : Clusters .OnOff = data [1 ][Clusters .OnOff ]
265
265
if (not cluster .onOff ):
266
266
raise ValueError ("Current On/Off state should be True" )
@@ -272,6 +272,7 @@ def subUpdate(path: TypedAttributePath, transaction: SubscriptionTransaction):
272
272
273
273
await asyncio .wait_for (event .wait (), timeout = 11 )
274
274
275
+ data = sub .GetAttributes ()
275
276
cluster : Clusters .OnOff = data [1 ][Clusters .OnOff ]
276
277
if (cluster .onOff ):
277
278
raise ValueError ("Current On/Off state should be False" )
@@ -298,7 +299,6 @@ async def TestSubscribeZeroMinInterval(cls, devCtrl):
298
299
logger .info ("Test Subscription With MinInterval of 0" )
299
300
sub = await devCtrl .ReadAttribute (nodeid = NODE_ID ,
300
301
attributes = [Clusters .OnOff , Clusters .LevelControl ], reportInterval = (0 , 60 ))
301
- data = sub .GetAttributes ()
302
302
303
303
logger .info ("Sending off command" )
304
304
@@ -315,6 +315,7 @@ async def TestSubscribeZeroMinInterval(cls, devCtrl):
315
315
316
316
logger .info ("Checking read back value is indeed 254" )
317
317
318
+ data = sub .GetAttributes ()
318
319
if (data [1 ][Clusters .LevelControl ][Clusters .LevelControl .Attributes .CurrentLevel ] != 254 ):
319
320
raise ValueError ("Current Level should have been 254" )
320
321
0 commit comments