Skip to content

Commit

Permalink
Merge pull request #87 from JuhaVainio/update-automation-section-refe…
Browse files Browse the repository at this point in the history
…rences

Rewrite Automation section after w3c/sensors#470
  • Loading branch information
anssiko authored Oct 20, 2023
2 parents adf6c8b + 7bbbbfa commit 2f5cf3f
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -417,22 +413,18 @@ 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.

<h3 id="mock-ambient-light-sensor-type">Mock Sensor Type</h3>

The {{AmbientLightSensor}} class has an associated [=mock sensor type=] which is
<a for="MockSensorType" enum-value>"ambient-light"</a>, its [=mock sensor reading values=]
dictionary is defined as follows:
<div algorithm>
The <dfn>illuminance reading parsing algorithm</dfn>, given a JSON {{Object}} |parameters|, must return the result of invoking [=parse single-value number reading=] with |parameters| and "`illuminance`".
</div>

<pre class="idl">
dictionary AmbientLightReadingValues {
required double? illuminance;
};
</pre>
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}
=========
Expand Down

0 comments on commit 2f5cf3f

Please sign in to comment.