From ce579afb6ecbfe2117ba9ff6f3aa7473ac327d04 Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Thu, 20 Jun 2024 19:32:19 +0200 Subject: [PATCH] fixup! Implement ExposedThing functionality --- lib/src/core/implementation/exposed_thing.dart | 13 ++++++++++++- .../core/protocol_interfaces/exposable_thing.dart | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/lib/src/core/implementation/exposed_thing.dart b/lib/src/core/implementation/exposed_thing.dart index a1e8b1a4..94ab6051 100644 --- a/lib/src/core/implementation/exposed_thing.dart +++ b/lib/src/core/implementation/exposed_thing.dart @@ -271,7 +271,7 @@ class ExposedThing implements scripting_api.ExposedThing, ExposableThing { } @override - Stream handleUnsubscribeEvent( + Future handleUnsubscribeEvent( String eventName, { int? formIndex, Map? uriVariables, @@ -292,4 +292,15 @@ class ExposedThing implements scripting_api.ExposedThing, ExposableThing { // TODO: implement handleWriteMultipleProperties throw UnimplementedError(); } + + @override + Future handleUnobserveProperty( + String eventName, { + int? formIndex, + Map? uriVariables, + Object? data, + }) { + // TODO: implement handleUnobserveProperty + throw UnimplementedError(); + } } diff --git a/lib/src/core/protocol_interfaces/exposable_thing.dart b/lib/src/core/protocol_interfaces/exposable_thing.dart index 8a6f3712..e62c0f44 100644 --- a/lib/src/core/protocol_interfaces/exposable_thing.dart +++ b/lib/src/core/protocol_interfaces/exposable_thing.dart @@ -7,6 +7,7 @@ import "../definitions.dart"; import "../implementation.dart"; +/// typedef PropertyContentMap = Map; /// Interface that allows ProtocolServers to interact with ExposedThings. @@ -23,6 +24,7 @@ abstract interface class ExposableThing { Object? data, }); + /// Handles a `readmultipleproperties` operation triggered by a TD consumer. Future handleReadMultipleProperties( List propertyNames, Content input, { @@ -31,6 +33,7 @@ abstract interface class ExposableThing { Object? data, }); + /// Handles a `readallproperties` operation triggered by a TD consumer. Future handleReadAllProperties( List propertyNames, PropertyContentMap inputs, { @@ -65,6 +68,14 @@ abstract interface class ExposableThing { Object? data, }); + /// Handles an `unobserveproperty` operation triggered by a TD consumer. + Future handleUnobserveProperty( + String eventName, { + int? formIndex, + Map? uriVariables, + Object? data, + }); + /// Handles an `invokeaction` operation triggered by a TD consumer. Future handleInvokeAction( String propertyName, @@ -83,7 +94,7 @@ abstract interface class ExposableThing { }); /// Handles an `unsubscribeevent` operation triggered by a TD consumer. - Stream handleUnsubscribeEvent( + Future handleUnsubscribeEvent( String eventName, { int? formIndex, Map? uriVariables,