Skip to content

Commit ac13ae0

Browse files
committed
fixup! Implement ExposedThing functionality
1 parent 2a88434 commit ac13ae0

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

lib/src/core/implementation/exposed_thing.dart

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -324,15 +324,22 @@ class ExposedThing implements scripting_api.ExposedThing, ExposableThing {
324324

325325
@override
326326
Future<void> handleWriteMultipleProperties(
327-
List<String> propertyNames,
328-
Content input, {
327+
PropertyContentMap inputs, {
329328
int? formIndex,
330329
Map<String, Object>? uriVariables,
331330
Object? data,
332-
}) {
333-
// TODO: implement handleWriteMultipleProperties
334-
throw UnimplementedError();
335-
}
331+
}) async =>
332+
Future.wait(
333+
inputs.entries.map(
334+
(propertyContentMapEntry) => handleWriteProperty(
335+
propertyContentMapEntry.key,
336+
propertyContentMapEntry.value,
337+
formIndex: formIndex,
338+
uriVariables: uriVariables,
339+
data: data,
340+
),
341+
),
342+
);
336343

337344
@override
338345
Future<void> handleObserveProperty(

lib/src/core/protocol_interfaces/exposable_thing.dart

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,7 @@ abstract interface class ExposableThing {
5050

5151
/// Handles a `writemultipleproperties` operation triggered by a TD consumer.
5252
Future<void> handleWriteMultipleProperties(
53-
List<String> propertyNames,
54-
Content input, {
53+
PropertyContentMap inputs, {
5554
int? formIndex,
5655
Map<String, Object>? uriVariables,
5756
Object? data,

0 commit comments

Comments
 (0)