File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -78,12 +78,17 @@ Future<void> main(List<String> args) async {
7878 '"${thingDescription.title}"!',
7979 );
8080
81+ print(consumedThing.thingDescription.events);
82+ final subscription = await consumedThing.subscribeEvent("change", print);
83+
8184 print("Incrementing counter ...");
8285 await consumedThing.invokeAction("increment");
8386
8487 final status = await consumedThing.readProperty("count");
8588 final value = await status.value();
8689 print("New counter value: $value");
90+
91+ await subscription.stop();
8792}
8893```
8994
Original file line number Diff line number Diff line change @@ -29,10 +29,15 @@ Future<void> main(List<String> args) async {
2929 '"${thingDescription .title }"!' ,
3030 );
3131
32+ print (consumedThing.thingDescription.events);
33+ final subscription = await consumedThing.subscribeEvent ("change" , print);
34+
3235 print ("Incrementing counter ..." );
3336 await consumedThing.invokeAction ("increment" );
3437
3538 final status = await consumedThing.readProperty ("count" );
3639 final value = await status.value ();
3740 print ("New counter value: $value " );
41+
42+ await subscription.stop ();
3843}
You can’t perform that action at this time.
0 commit comments