Skip to content

Commit ce579af

Browse files
committed
fixup! Implement ExposedThing functionality
1 parent 2dcba20 commit ce579af

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

lib/src/core/implementation/exposed_thing.dart

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ class ExposedThing implements scripting_api.ExposedThing, ExposableThing {
271271
}
272272

273273
@override
274-
Stream<Content> handleUnsubscribeEvent(
274+
Future<void> handleUnsubscribeEvent(
275275
String eventName, {
276276
int? formIndex,
277277
Map<String, Object>? uriVariables,
@@ -292,4 +292,15 @@ class ExposedThing implements scripting_api.ExposedThing, ExposableThing {
292292
// TODO: implement handleWriteMultipleProperties
293293
throw UnimplementedError();
294294
}
295+
296+
@override
297+
Future<void> handleUnobserveProperty(
298+
String eventName, {
299+
int? formIndex,
300+
Map<String, Object>? uriVariables,
301+
Object? data,
302+
}) {
303+
// TODO: implement handleUnobserveProperty
304+
throw UnimplementedError();
305+
}
295306
}

lib/src/core/protocol_interfaces/exposable_thing.dart

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import "../definitions.dart";
88
import "../implementation.dart";
99

10+
///
1011
typedef PropertyContentMap = Map<String, Content>;
1112

1213
/// Interface that allows ProtocolServers to interact with ExposedThings.
@@ -23,6 +24,7 @@ abstract interface class ExposableThing {
2324
Object? data,
2425
});
2526

27+
/// Handles a `readmultipleproperties` operation triggered by a TD consumer.
2628
Future<PropertyContentMap> handleReadMultipleProperties(
2729
List<String> propertyNames,
2830
Content input, {
@@ -31,6 +33,7 @@ abstract interface class ExposableThing {
3133
Object? data,
3234
});
3335

36+
/// Handles a `readallproperties` operation triggered by a TD consumer.
3437
Future<void> handleReadAllProperties(
3538
List<String> propertyNames,
3639
PropertyContentMap inputs, {
@@ -65,6 +68,14 @@ abstract interface class ExposableThing {
6568
Object? data,
6669
});
6770

71+
/// Handles an `unobserveproperty` operation triggered by a TD consumer.
72+
Future<void> handleUnobserveProperty(
73+
String eventName, {
74+
int? formIndex,
75+
Map<String, Object>? uriVariables,
76+
Object? data,
77+
});
78+
6879
/// Handles an `invokeaction` operation triggered by a TD consumer.
6980
Future<Content?> handleInvokeAction(
7081
String propertyName,
@@ -83,7 +94,7 @@ abstract interface class ExposableThing {
8394
});
8495

8596
/// Handles an `unsubscribeevent` operation triggered by a TD consumer.
86-
Stream<Content> handleUnsubscribeEvent(
97+
Future<void> handleUnsubscribeEvent(
8798
String eventName, {
8899
int? formIndex,
89100
Map<String, Object>? uriVariables,

0 commit comments

Comments
 (0)