registry: RangeController, ModeController, ToggleController with resources, presets and semantics
The three generic controllers are described in full and leave the stub table (62 stubs remain). A declaration
takes an instance name, friendly names from text() and asset(), and the options of the interface: range, unit and
presets for a range; supportedModes and ordered for a mode; semantics() for all three, with actions mapped to
directives and states mapped to a value or a range of values.
Refused at device.add(), each with the endpoint, interface and instance in the message: no instance name or no
friendly name; an instance declared twice; a first friendly name or a phrase used by another capability of the
endpoint; a reserved word, an asset id that is not in the catalog; range.max not above range.min; a preset off the
precision grid or outside the range; fewer than two modes or a mode listed twice; a mapping to a directive the
interface does not have, to a payload that does not fit, to a mode that is not listed, to AdjustMode on modes
that are not ordered; SetEcoOn, SetEcoOff, EcoOn and EcoOff on anything but a toggle.
For 1.x callers: Alexa.RangeController lists rangeValue (1.5.2 sent supported: []); addSupportedModes() announces
a mode given as a string as { value } and notes it, and takes { ordered: false } as a second argument, the default
stays true as 1.5.2 sent it (device.add() defaults to false). Declared the 1.x way, the zoo fan and curtain give
the same JSON as before.
Tests: the zoo blind, whose range, unit and semantics were written by hand into the JSON of 1.5.2, is declared
with device.add() and equals that JSON plus the Alexa capability; five capability objects of Amazon's examples
are reproduced the same way. 27 examples of four pages added. npm test: 108 pass (was 85) in 10.5-11.3 s, also on
Node 18.20.8 and 20.20.2.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
c492ef74d1
commit
2558e21787
80 changed files with 3131 additions and 107 deletions
13
test/fixtures/alexa-docs/alexa-discovery-objects/actionMapping.json
vendored
Normal file
13
test/fixtures/alexa-docs/alexa-discovery-objects/actionMapping.json
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"@type": "ActionsToDirective",
|
||||
"actions": [
|
||||
"Alexa.Actions.Close",
|
||||
"Alexa.Actions.Lower"
|
||||
],
|
||||
"directive": {
|
||||
"name": "SetRangeValue",
|
||||
"payload": {
|
||||
"rangeValue": 0
|
||||
}
|
||||
}
|
||||
}
|
||||
51
test/fixtures/alexa-docs/alexa-discovery-objects/semantics.json
vendored
Normal file
51
test/fixtures/alexa-docs/alexa-discovery-objects/semantics.json
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"semantics": {
|
||||
"actionMappings": [
|
||||
{
|
||||
"@type": "ActionsToDirective",
|
||||
"actions": [
|
||||
"Alexa.Actions.Close",
|
||||
"Alexa.Actions.Lower"
|
||||
],
|
||||
"directive": {
|
||||
"name": "SetRangeValue",
|
||||
"payload": {
|
||||
"rangeValue": 0
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "ActionsToDirective",
|
||||
"actions": [
|
||||
"Alexa.Actions.Open",
|
||||
"Alexa.Actions.Raise"
|
||||
],
|
||||
"directive": {
|
||||
"name": "SetRangeValue",
|
||||
"payload": {
|
||||
"rangeValue": 100
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"stateMappings": [
|
||||
{
|
||||
"@type": "StatesToValue",
|
||||
"states": [
|
||||
"Alexa.States.Closed"
|
||||
],
|
||||
"value": 0
|
||||
},
|
||||
{
|
||||
"@type": "StatesToRange",
|
||||
"states": [
|
||||
"Alexa.States.Open"
|
||||
],
|
||||
"range": {
|
||||
"minimumValue": 1,
|
||||
"maximumValue": 100
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
10
test/fixtures/alexa-docs/alexa-discovery-objects/stateMapping.json
vendored
Normal file
10
test/fixtures/alexa-docs/alexa-discovery-objects/stateMapping.json
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"@type": "StatesToRange",
|
||||
"states": [
|
||||
"Alexa.States.Open"
|
||||
],
|
||||
"range": {
|
||||
"minimumValue": 1,
|
||||
"maximumValue": 100
|
||||
}
|
||||
}
|
||||
23
test/fixtures/alexa-docs/alexa-modecontroller/AdjustMode.directive.json
vendored
Normal file
23
test/fixtures/alexa-docs/alexa-modecontroller/AdjustMode.directive.json
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"directive": {
|
||||
"header": {
|
||||
"namespace": "Alexa.ModeController",
|
||||
"instance": "Washer.WashTemperature",
|
||||
"name": "AdjustMode",
|
||||
"messageId": "Unique version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID",
|
||||
"cookie": {}
|
||||
},
|
||||
"payload": {
|
||||
"modeDelta": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
31
test/fixtures/alexa-docs/alexa-modecontroller/AdjustMode.response.json
vendored
Normal file
31
test/fixtures/alexa-docs/alexa-modecontroller/AdjustMode.response.json
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa",
|
||||
"name": "Response",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token that matches the request",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID"
|
||||
},
|
||||
"payload": {}
|
||||
},
|
||||
"context": {
|
||||
"properties": [
|
||||
{
|
||||
"namespace": "Alexa.ModeController",
|
||||
"instance": "Washer.WashTemperature",
|
||||
"name": "mode",
|
||||
"value": "WashTemperature.Warm",
|
||||
"timeOfSample": "2017-02-03T16:20:00.00Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
43
test/fixtures/alexa-docs/alexa-modecontroller/ChangeReport.json
vendored
Normal file
43
test/fixtures/alexa-docs/alexa-modecontroller/ChangeReport.json
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa",
|
||||
"name": "ChangeReport",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID"
|
||||
},
|
||||
"payload": {
|
||||
"change": {
|
||||
"cause": {
|
||||
"type": "PHYSICAL_INTERACTION"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"namespace": "Alexa.ModeController",
|
||||
"instance": "Washer.WashTemperature",
|
||||
"name": "mode",
|
||||
"value": "WashTemperature.Hot",
|
||||
"timeOfSample": "2024-02-03T17:10:50.52Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"context": {
|
||||
"namespace": "Alexa.EndpointHealth",
|
||||
"name": "connectivity",
|
||||
"value": {
|
||||
"value": "OK"
|
||||
},
|
||||
"timeOfSample": "2024-02-03T17:08:20.12Z",
|
||||
"uncertaintyInMilliseconds": 10000
|
||||
}
|
||||
}
|
||||
23
test/fixtures/alexa-docs/alexa-modecontroller/SetMode.directive.json
vendored
Normal file
23
test/fixtures/alexa-docs/alexa-modecontroller/SetMode.directive.json
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"directive": {
|
||||
"header": {
|
||||
"namespace": "Alexa.ModeController",
|
||||
"instance": "Washer.WashCycle",
|
||||
"name": "SetMode",
|
||||
"messageId": "Unique version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID",
|
||||
"cookie": {}
|
||||
},
|
||||
"payload": {
|
||||
"mode": "WashCycle.Normal"
|
||||
}
|
||||
}
|
||||
}
|
||||
31
test/fixtures/alexa-docs/alexa-modecontroller/SetMode.response.json
vendored
Normal file
31
test/fixtures/alexa-docs/alexa-modecontroller/SetMode.response.json
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa",
|
||||
"name": "Response",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token that matches the request",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID"
|
||||
},
|
||||
"payload": {}
|
||||
},
|
||||
"context": {
|
||||
"properties": [
|
||||
{
|
||||
"namespace": "Alexa.ModeController",
|
||||
"instance": "Washer.WashCycle",
|
||||
"name": "mode",
|
||||
"value": "WashCycle.Normal",
|
||||
"timeOfSample": "2017-02-03T16:20:00.00Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
31
test/fixtures/alexa-docs/alexa-modecontroller/StateReport.json
vendored
Normal file
31
test/fixtures/alexa-docs/alexa-modecontroller/StateReport.json
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa",
|
||||
"name": "StateReport",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token that matches the request",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID"
|
||||
},
|
||||
"payload": {}
|
||||
},
|
||||
"context": {
|
||||
"properties": [
|
||||
{
|
||||
"namespace": "Alexa.ModeController",
|
||||
"instance": "Washer.WashCycle",
|
||||
"name": "mode",
|
||||
"value": "WashCycle.Delicates",
|
||||
"timeOfSample": "2017-02-03T16:20:00.00Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
6
test/fixtures/alexa-docs/alexa-modecontroller/mode.property.json
vendored
Normal file
6
test/fixtures/alexa-docs/alexa-modecontroller/mode.property.json
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"namespace": "Alexa.ModeController",
|
||||
"name": "mode",
|
||||
"instance": "Washer.WashTemperature",
|
||||
"value": "WashTemperature.Cold"
|
||||
}
|
||||
24
test/fixtures/alexa-docs/alexa-rangecontroller/AdjustRangeValue.directive.json
vendored
Normal file
24
test/fixtures/alexa-docs/alexa-rangecontroller/AdjustRangeValue.directive.json
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"directive": {
|
||||
"header": {
|
||||
"namespace": "Alexa.RangeController",
|
||||
"instance": "Fan.Speed",
|
||||
"name": "AdjustRangeValue",
|
||||
"messageId": "Unique version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID",
|
||||
"cookie": {}
|
||||
},
|
||||
"payload": {
|
||||
"rangeValueDelta": -5,
|
||||
"rangeValueDeltaDefault": false
|
||||
}
|
||||
}
|
||||
}
|
||||
31
test/fixtures/alexa-docs/alexa-rangecontroller/AdjustRangeValue.response.json
vendored
Normal file
31
test/fixtures/alexa-docs/alexa-rangecontroller/AdjustRangeValue.response.json
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa",
|
||||
"name": "Response",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token that matches the request",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID"
|
||||
},
|
||||
"payload": {}
|
||||
},
|
||||
"context": {
|
||||
"properties": [
|
||||
{
|
||||
"namespace": "Alexa.RangeController",
|
||||
"instance": "Fan.Speed",
|
||||
"name": "rangeValue",
|
||||
"value": 10,
|
||||
"timeOfSample": "2017-02-03T16:20:50.52Z",
|
||||
"uncertaintyInMilliseconds": 500
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
50
test/fixtures/alexa-docs/alexa-rangecontroller/ChangeReport.json
vendored
Normal file
50
test/fixtures/alexa-docs/alexa-rangecontroller/ChangeReport.json
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa",
|
||||
"name": "ChangeReport",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID"
|
||||
},
|
||||
"payload": {
|
||||
"change": {
|
||||
"cause": {
|
||||
"type": "PHYSICAL_INTERACTION"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"namespace": "Alexa.RangeController",
|
||||
"instance": "Fan.Speed",
|
||||
"name": "rangeValue",
|
||||
"value": 0,
|
||||
"timeOfSample": "2017-02-03T16:20:50.52Z",
|
||||
"uncertaintyInMilliseconds": 500
|
||||
},
|
||||
{
|
||||
"namespace": "Alexa.PowerController",
|
||||
"name": "powerState",
|
||||
"value": "OFF",
|
||||
"timeOfSample": "2017-02-03T16:20:50.52Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"context": {
|
||||
"namespace": "Alexa.EndpointHealth",
|
||||
"name": "connectivity",
|
||||
"value": {
|
||||
"value": "OK"
|
||||
},
|
||||
"timeOfSample": "2017-02-03T16:20:00.00Z",
|
||||
"uncertaintyInMilliseconds": 60000
|
||||
}
|
||||
}
|
||||
23
test/fixtures/alexa-docs/alexa-rangecontroller/SetRangeValue.directive.json
vendored
Normal file
23
test/fixtures/alexa-docs/alexa-rangecontroller/SetRangeValue.directive.json
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"directive": {
|
||||
"header": {
|
||||
"namespace": "Alexa.RangeController",
|
||||
"instance": "Fan.Speed",
|
||||
"name": "SetRangeValue",
|
||||
"messageId": "Unique version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID",
|
||||
"cookie": {}
|
||||
},
|
||||
"payload": {
|
||||
"rangeValue": 7
|
||||
}
|
||||
}
|
||||
}
|
||||
31
test/fixtures/alexa-docs/alexa-rangecontroller/SetRangeValue.response.json
vendored
Normal file
31
test/fixtures/alexa-docs/alexa-rangecontroller/SetRangeValue.response.json
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa",
|
||||
"name": "Response",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token that matches the request",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID"
|
||||
},
|
||||
"payload": {}
|
||||
},
|
||||
"context": {
|
||||
"properties": [
|
||||
{
|
||||
"namespace": "Alexa.RangeController",
|
||||
"instance": "Fan.Speed",
|
||||
"name": "rangeValue",
|
||||
"value": 7,
|
||||
"timeOfSample": "2017-02-03T16:20:50.52Z",
|
||||
"uncertaintyInMilliseconds": 500
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
38
test/fixtures/alexa-docs/alexa-rangecontroller/StateReport.json
vendored
Normal file
38
test/fixtures/alexa-docs/alexa-rangecontroller/StateReport.json
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa",
|
||||
"name": "StateReport",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token that matches the request",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID"
|
||||
},
|
||||
"payload": {}
|
||||
},
|
||||
"context": {
|
||||
"properties": [
|
||||
{
|
||||
"namespace": "Alexa.RangeController",
|
||||
"instance": "Fan.Speed",
|
||||
"name": "rangeValue",
|
||||
"value": 4,
|
||||
"timeOfSample": "2017-02-03T16:21:00.00Z",
|
||||
"uncertaintyInMilliseconds": 500
|
||||
},
|
||||
{
|
||||
"namespace": "Alexa.PowerController",
|
||||
"name": "powerState",
|
||||
"value": "ON",
|
||||
"timeOfSample": "2017-02-03T16:20:00.00Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
6
test/fixtures/alexa-docs/alexa-rangecontroller/rangeValue.property.json
vendored
Normal file
6
test/fixtures/alexa-docs/alexa-rangecontroller/rangeValue.property.json
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"namespace": "Alexa.RangeController",
|
||||
"instance": "Fan.Speed",
|
||||
"name": "rangeValue",
|
||||
"value": 10
|
||||
}
|
||||
51
test/fixtures/alexa-docs/alexa-togglecontroller/ChangeReport.json
vendored
Normal file
51
test/fixtures/alexa-docs/alexa-togglecontroller/ChangeReport.json
vendored
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa",
|
||||
"name": "ChangeReport",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID"
|
||||
},
|
||||
"payload": {
|
||||
"change": {
|
||||
"cause": {
|
||||
"type": "PHYSICAL_INTERACTION"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"namespace": "Alexa.ToggleController",
|
||||
"instance": "Oven.OvenLight",
|
||||
"name": "toggleState",
|
||||
"value": "OFF",
|
||||
"timeOfSample": "2017-02-04T16:20:50.52Z",
|
||||
"uncertaintyInMilliseconds": 500
|
||||
},
|
||||
{
|
||||
"namespace": "Alexa.ToggleController",
|
||||
"instance": "Stovetop.ResidualHeat",
|
||||
"name": "toggleState",
|
||||
"value": "ON",
|
||||
"timeOfSample": "2017-02-04T16:20:50.42Z",
|
||||
"uncertaintyInMilliseconds": 500
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"context": {
|
||||
"namespace": "Alexa.EndpointHealth",
|
||||
"name": "connectivity",
|
||||
"value": {
|
||||
"value": "OK"
|
||||
},
|
||||
"timeOfSample": "2017-02-04T16:00:00.00Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
}
|
||||
}
|
||||
39
test/fixtures/alexa-docs/alexa-togglecontroller/StateReport.json
vendored
Normal file
39
test/fixtures/alexa-docs/alexa-togglecontroller/StateReport.json
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa",
|
||||
"name": "StateReport",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token that matches the request",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID"
|
||||
},
|
||||
"payload": {}
|
||||
},
|
||||
"context": {
|
||||
"properties": [
|
||||
{
|
||||
"namespace": "Alexa.ToggleController",
|
||||
"instance": "Stovetop.ResidualHeat",
|
||||
"name": "toggleState",
|
||||
"value": "OFF",
|
||||
"timeOfSample": "2017-02-03T16:20:50.52Z",
|
||||
"uncertaintyInMilliseconds": 500
|
||||
},
|
||||
{
|
||||
"namespace": "Alexa.ToggleController",
|
||||
"instance": "Oven.Light",
|
||||
"name": "toggleState",
|
||||
"value": "ON",
|
||||
"timeOfSample": "2017-02-04T08:00:00.10Z",
|
||||
"uncertaintyInMilliseconds": 500
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
21
test/fixtures/alexa-docs/alexa-togglecontroller/TurnOff.directive.json
vendored
Normal file
21
test/fixtures/alexa-docs/alexa-togglecontroller/TurnOff.directive.json
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"directive": {
|
||||
"header": {
|
||||
"namespace": "Alexa.ToggleController",
|
||||
"instance": "Oven.Light",
|
||||
"name": "TurnOff",
|
||||
"messageId": "Unique version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID",
|
||||
"cookie": {}
|
||||
},
|
||||
"payload": {}
|
||||
}
|
||||
}
|
||||
31
test/fixtures/alexa-docs/alexa-togglecontroller/TurnOff.response.json
vendored
Normal file
31
test/fixtures/alexa-docs/alexa-togglecontroller/TurnOff.response.json
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa",
|
||||
"name": "Response",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token that matches the request",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID"
|
||||
},
|
||||
"payload": {}
|
||||
},
|
||||
"context": {
|
||||
"properties": [
|
||||
{
|
||||
"namespace": "Alexa.ToggleController",
|
||||
"instance": "Oven.Light",
|
||||
"name": "toggleState",
|
||||
"value": "OFF",
|
||||
"timeOfSample": "2017-02-03T16:20:50.52Z",
|
||||
"uncertaintyInMilliseconds": 500
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
21
test/fixtures/alexa-docs/alexa-togglecontroller/TurnOn.directive.json
vendored
Normal file
21
test/fixtures/alexa-docs/alexa-togglecontroller/TurnOn.directive.json
vendored
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"directive": {
|
||||
"header": {
|
||||
"namespace": "Alexa.ToggleController",
|
||||
"instance": "Oven.Light",
|
||||
"name": "TurnOn",
|
||||
"messageId": "Unique version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID",
|
||||
"cookie": {}
|
||||
},
|
||||
"payload": {}
|
||||
}
|
||||
}
|
||||
31
test/fixtures/alexa-docs/alexa-togglecontroller/TurnOn.response.json
vendored
Normal file
31
test/fixtures/alexa-docs/alexa-togglecontroller/TurnOn.response.json
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa",
|
||||
"name": "Response",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token that matches the request",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint ID"
|
||||
},
|
||||
"payload": {}
|
||||
},
|
||||
"context": {
|
||||
"properties": [
|
||||
{
|
||||
"namespace": "Alexa.ToggleController",
|
||||
"instance": "Oven.Light",
|
||||
"name": "toggleState",
|
||||
"value": "ON",
|
||||
"timeOfSample": "2017-02-03T16:20:50.52Z",
|
||||
"uncertaintyInMilliseconds": 500
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
127
test/fixtures/alexa-docs/alexa-togglecontroller/discovery-oven.json
vendored
Normal file
127
test/fixtures/alexa-docs/alexa-togglecontroller/discovery-oven.json
vendored
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa.Discovery",
|
||||
"name": "Discover.Response",
|
||||
"payloadVersion": "3",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID"
|
||||
},
|
||||
"payload": {
|
||||
"endpoints": [
|
||||
{
|
||||
"endpointId": "Unique ID of the endpoint",
|
||||
"manufacturerName": "Kitchen Appliance Plus",
|
||||
"description": "Smart Oven by Kitchen Appliance Plus",
|
||||
"friendlyName": "Oven",
|
||||
"displayCategories": [
|
||||
"OVEN"
|
||||
],
|
||||
"cookie": {},
|
||||
"capabilities": [
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.ToggleController",
|
||||
"instance": "Oven.OvenLight",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "toggleState"
|
||||
}
|
||||
],
|
||||
"proactivelyReported": true,
|
||||
"retrievable": true,
|
||||
"nonControllable": false
|
||||
},
|
||||
"capabilityResources": {
|
||||
"friendlyNames": [
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Oven light",
|
||||
"locale": "en-US"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Luz del horno",
|
||||
"locale": "es-MX"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Lumière du four",
|
||||
"locale": "fr-CA"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.ToggleController",
|
||||
"instance": "Stovetop.ResidualHeat",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "toggleState"
|
||||
}
|
||||
],
|
||||
"proactivelyReported": true,
|
||||
"retrievable": true,
|
||||
"nonControllable": true
|
||||
},
|
||||
"capabilityResources": {
|
||||
"friendlyNames": [
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Stovetop is still hot",
|
||||
"locale": "en-US"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Todavía está caliente",
|
||||
"locale": "es-MX"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Encore chaude",
|
||||
"locale": "fr-CA"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.EndpointHealth",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "connectivity"
|
||||
}
|
||||
],
|
||||
"proactivelyReported": true,
|
||||
"retrievable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa",
|
||||
"version": "3"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
247
test/fixtures/alexa-docs/alexa-togglecontroller/discovery-range-and-toggle.json
vendored
Normal file
247
test/fixtures/alexa-docs/alexa-togglecontroller/discovery-range-and-toggle.json
vendored
Normal file
|
|
@ -0,0 +1,247 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa.Discovery",
|
||||
"name": "Discover.Response",
|
||||
"payloadVersion": "3",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID"
|
||||
},
|
||||
"payload": {
|
||||
"endpoints": [
|
||||
{
|
||||
"endpointId": "Unique ID of the endpoint",
|
||||
"friendlyName": "Tower Fan",
|
||||
"description": "Tower Fan by Sample Manufacturer",
|
||||
"manufacturerName": "Sample Manufacturer",
|
||||
"displayCategories": [
|
||||
"FAN"
|
||||
],
|
||||
"cookie": {},
|
||||
"capabilities": [
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.ToggleController",
|
||||
"version": "3",
|
||||
"instance": "SampleManufacturer.Fan.Oscillate",
|
||||
"capabilityResources": {
|
||||
"friendlyNames": [
|
||||
{
|
||||
"@type": "asset",
|
||||
"value": {
|
||||
"assetId": "Alexa.Setting.Oscillate"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Rotate",
|
||||
"locale": "en-US"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Rotation",
|
||||
"locale": "en-US"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Girar",
|
||||
"locale": "es-MX"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Rotation",
|
||||
"locale": "fr-CA"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"proactivelyReported": true,
|
||||
"retrievable": true,
|
||||
"supported": [
|
||||
{
|
||||
"name": "toggleState"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.RangeController",
|
||||
"version": "3",
|
||||
"instance": "SampleManufacturer.Fan.Speed",
|
||||
"capabilityResources": {
|
||||
"friendlyNames": [
|
||||
{
|
||||
"@type": "asset",
|
||||
"value": {
|
||||
"assetId": "Alexa.Setting.FanSpeed"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Speed",
|
||||
"locale": "en-US"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Velocidad",
|
||||
"locale": "es-MX"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Vitesse",
|
||||
"locale": "fr-CA"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "rangeValue"
|
||||
}
|
||||
],
|
||||
"proactivelyReported": true,
|
||||
"retrievable": true
|
||||
},
|
||||
"configuration": {
|
||||
"supportedRange": {
|
||||
"minimumValue": 1,
|
||||
"maximumValue": 10,
|
||||
"precision": 1
|
||||
},
|
||||
"presets": [
|
||||
{
|
||||
"rangeValue": 10,
|
||||
"presetResources": {
|
||||
"friendlyNames": [
|
||||
{
|
||||
"@type": "asset",
|
||||
"value": {
|
||||
"assetId": "Alexa.Value.Maximum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "asset",
|
||||
"value": {
|
||||
"assetId": "Alexa.Value.High"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Highest",
|
||||
"locale": "en-US"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Fast",
|
||||
"locale": "en-US"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Alta",
|
||||
"locale": "es-MX"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Élevée",
|
||||
"locale": "fr-CA"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"rangeValue": 1,
|
||||
"presetResources": {
|
||||
"friendlyNames": [
|
||||
{
|
||||
"@type": "asset",
|
||||
"value": {
|
||||
"assetId": "Alexa.Value.Minimum"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "asset",
|
||||
"value": {
|
||||
"assetId": "Alexa.Value.Low"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Lowest",
|
||||
"locale": "en-US"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Slow",
|
||||
"locale": "en-US"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Baja",
|
||||
"locale": "es-MX"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Faible",
|
||||
"locale": "fr-CA"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.PowerController",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "powerState"
|
||||
}
|
||||
],
|
||||
"proactivelyReported": true,
|
||||
"retrievable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa",
|
||||
"version": "3"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
111
test/fixtures/alexa-docs/alexa-togglecontroller/discovery-semantics.json
vendored
Normal file
111
test/fixtures/alexa-docs/alexa-togglecontroller/discovery-semantics.json
vendored
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa.Discovery",
|
||||
"name": "Discover.Response",
|
||||
"payloadVersion": "3",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID"
|
||||
},
|
||||
"payload": {
|
||||
"endpoints": [
|
||||
{
|
||||
"endpointId": "Unique ID of the endpoint",
|
||||
"manufacturerName": "manufacturer name",
|
||||
"description": "Smart Garbage Can by Manufacturer",
|
||||
"friendlyName": "garbage can",
|
||||
"displayCategories": [
|
||||
"OTHER"
|
||||
],
|
||||
"cookie": {},
|
||||
"capabilities": [
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.ToggleController",
|
||||
"instance": "GarbageCan.Lid",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "toggleState"
|
||||
}
|
||||
],
|
||||
"proactivelyReported": true,
|
||||
"retrievable": true
|
||||
},
|
||||
"capabilityResources": {
|
||||
"friendlyNames": [
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Garbage can lid",
|
||||
"locale": "en-US"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Tapa del bote de basura",
|
||||
"locale": "es-MX"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Couvercle de poubelle",
|
||||
"locale": "fr-CA"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"semantics": {
|
||||
"actionMappings": [
|
||||
{
|
||||
"@type": "ActionsToDirective",
|
||||
"actions": [
|
||||
"Alexa.Actions.Close"
|
||||
],
|
||||
"directive": {
|
||||
"name": "TurnOff",
|
||||
"payload": {}
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "ActionsToDirective",
|
||||
"actions": [
|
||||
"Alexa.Actions.Open"
|
||||
],
|
||||
"directive": {
|
||||
"name": "TurnOn",
|
||||
"payload": {}
|
||||
}
|
||||
}
|
||||
],
|
||||
"stateMappings": [
|
||||
{
|
||||
"@type": "StatesToValue",
|
||||
"states": [
|
||||
"Alexa.States.Closed"
|
||||
],
|
||||
"value": "OFF"
|
||||
},
|
||||
{
|
||||
"@type": "StatesToValue",
|
||||
"states": [
|
||||
"Alexa.States.Open"
|
||||
],
|
||||
"value": "ON"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa",
|
||||
"version": "3"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
6
test/fixtures/alexa-docs/alexa-togglecontroller/toggleState.property.json
vendored
Normal file
6
test/fixtures/alexa-docs/alexa-togglecontroller/toggleState.property.json
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"namespace": "Alexa.ToggleController",
|
||||
"instance": "Oven.OvenLight",
|
||||
"name": "toggleState",
|
||||
"value": "ON"
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue