From e9f4d7401ab8bf9944b1db313ca315fa62ea5d17 Mon Sep 17 00:00:00 2001 From: Juha Vainio Date: Wed, 18 Oct 2023 10:01:02 +0300 Subject: [PATCH 1/2] Rewrite Automation section after w3c/sensors#470 The Automation section in the Generic Sensor API specification was rewritten and several terms and concepts have changed. This commit adapts the Ambient Light Sensor spec to the changes: * Remove references to "mock sensor type", "mock sensor reading values" and the "MockSensorType" enum. * Define an entry in the per-type virtual sensor metadata map whose key is what used to be the "ambient-light" entry in MockSensorType and an appropriate virtual sensor metadata entry. This is enough to integrate properly with the Generic Sensor spec and allow Ambient Light virtual sensors to be created and used. Fixes #86. --- index.bs | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/index.bs b/index.bs index b1a8f54..03b39cd 100644 --- a/index.bs +++ b/index.bs @@ -44,10 +44,6 @@ urlPrefix: https://w3c.github.io/sensors/; spec: GENERIC-SENSOR text: mitigation strategies; url: mitigation-strategies text: sampling frequency text: sensor type - text: automation - text: mock sensor type - text: MockSensorType - text: mock sensor reading values text: latest reading urlPrefix: https://tc39.es/ecma262/; spec: ECMA-262 type: abstract-op @@ -417,22 +413,17 @@ quantization algorithm=]: Automation {#automation} ========== -This section extends the [=automation=] section defined in the Generic Sensor API [[GENERIC-SENSOR]] -to provide mocking information about the ambient light levels for the purposes of testing a user agent's -implementation of [=Ambient Light Sensor=]. +This section extends [[GENERIC-SENSOR#automation]] by providing [=Ambient Light Sensor=]-specific virtual sensor metadata. +
+The illuminance reading parsing algorithm, given a JSON {{Object}} |parameters|, must return the result of invoking [=parse single-value number reading=] with |parameters| and "`illuminance`". +
-

Mock Sensor Type

- -The {{AmbientLightSensor}} class has an associated [=mock sensor type=] which is -"ambient-light", its [=mock sensor reading values=] -dictionary is defined as follows: - -
-  dictionary AmbientLightReadingValues {
-    required double? illuminance;
-  };
-
+The [=per-type virtual sensor metadata=] [=map=] must have the following [=map/entry=]: +: [=map/key=] +:: "`ambient-light`" +: [=map/value=] +:: A [=virtual sensor metadata=] whose [=virtual sensor metadata/virtual sensor type=] is [=Ambient Light Sensor=] and [=reading parsing algorithm=] is [=illuminance reading parsing algorithm=]. Use Cases and Requirements {#usecases-requirements} ========= From 7bbbbfad1940bd66a2bdf3fa201a4698f511da89 Mon Sep 17 00:00:00 2001 From: Juha Vainio Date: Fri, 20 Oct 2023 14:19:35 +0300 Subject: [PATCH 2/2] Add extra empty line before paragraph as Bikeshed reuires --- index.bs | 1 + 1 file changed, 1 insertion(+) diff --git a/index.bs b/index.bs index 03b39cd..b15a9ca 100644 --- a/index.bs +++ b/index.bs @@ -413,6 +413,7 @@ quantization algorithm=]: Automation {#automation} ========== + This section extends [[GENERIC-SENSOR#automation]] by providing [=Ambient Light Sensor=]-specific virtual sensor metadata.