registry: SceneController events, DoorbellEventSource, SimpleEventSource, TimeHoldController, InventoryLevelSensor, WakeOnLANController
Six descriptors written from their pages replace the last stubs of tiers 1 and 2. A scene answers Activate and Deactivate through ctx.respond() with ActivationStarted and DeactivationStarted, the time and the cause filled in. device.raise(descriptor, name, payload) publishes DoorbellPress and the Event of a button on <root>/event with the endpoint and a new messageId; it throws a MessageError for an interface or instance the device did not declare, an event that answers a directive, a payload that does not fit and a message over 16000 bytes. TurnOn of a device with WakeOnLANController is deferred without the warning. On the wire: a doorbell has no properties object and proactivelyReported on the capability; SimpleEventSource is version 1.0, InventoryLevelSensor and WakeOnLANController version 3 (1.5.2: 1). A scene declared without options is announced as before. Alex2MQTT has no topic yet for the WakeUp event. 24 examples of the six pages are saved as fixtures. 267 tests pass, 241 before. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
d7dfc5b122
commit
3a07c861b1
116 changed files with 3136 additions and 166 deletions
24
test/fixtures/alexa-docs/alexa-doorbelleventsource/DoorbellPress.event.json
vendored
Normal file
24
test/fixtures/alexa-docs/alexa-doorbelleventsource/DoorbellPress.event.json
vendored
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"context": {},
|
||||
"event": {
|
||||
"header": {
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"namespace": "Alexa.DoorbellEventSource",
|
||||
"name": "DoorbellPress",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "access-token-from-Amazon"
|
||||
},
|
||||
"endpointId": "appliance-001"
|
||||
},
|
||||
"payload": {
|
||||
"cause": {
|
||||
"type": "PHYSICAL_INTERACTION"
|
||||
},
|
||||
"timestamp": "2018-06-09T23:23:23.23Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
60
test/fixtures/alexa-docs/alexa-doorbelleventsource/discovery.json
vendored
Normal file
60
test/fixtures/alexa-docs/alexa-doorbelleventsource/discovery.json
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
{
|
||||
"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": "Sample Manufacturer",
|
||||
"description": "Description that appears in the Alexa app",
|
||||
"friendlyName": "Your device name, displayed in the Alexa app",
|
||||
"displayCategories": [
|
||||
"CAMERA",
|
||||
"DOORBELL"
|
||||
],
|
||||
"additionalAttributes": {
|
||||
"manufacturer": "Sample Manufacturer",
|
||||
"model": "Sample Model",
|
||||
"serialNumber": "Serial number of the device",
|
||||
"firmwareVersion": "Firmware version of the device",
|
||||
"softwareVersion": "Software version of the device",
|
||||
"customIdentifier": "Optional custom identifier for the device"
|
||||
},
|
||||
"cookie": {},
|
||||
"capabilities": [
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.DoorbellEventSource",
|
||||
"version": "3",
|
||||
"proactivelyReported": true
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.EndpointHealth",
|
||||
"version": "3.1",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "connectivity"
|
||||
}
|
||||
],
|
||||
"proactivelyReported": true,
|
||||
"retrievable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa",
|
||||
"version": "3"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
65
test/fixtures/alexa-docs/alexa-inventorylevelsensor/ChangeReport.json
vendored
Normal file
65
test/fixtures/alexa-docs/alexa-inventorylevelsensor/ChangeReport.json
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
{
|
||||
"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": "PERIODIC_POLL"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"namespace": "Alexa.InventoryLevelSensor",
|
||||
"instance": "InkSensor.Cyan",
|
||||
"name": "level",
|
||||
"value": {
|
||||
"@type": "Volume",
|
||||
"value": 5,
|
||||
"unit": "MILLILITER"
|
||||
},
|
||||
"timeOfSample": "2019-10-31T17:00:00.00Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
},
|
||||
{
|
||||
"namespace": "Alexa.InventoryLevelSensor",
|
||||
"instance": "PaperSensor.FrontTray",
|
||||
"name": "level",
|
||||
"value": {
|
||||
"@type": "Count",
|
||||
"value": 200
|
||||
},
|
||||
"timeOfSample": "2019-10-31T17:00:00.00Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
},
|
||||
{
|
||||
"namespace": "Alexa.PowerController",
|
||||
"name": "powerState",
|
||||
"value": "ON",
|
||||
"timeOfSample": "2019-10-31T17:00:00.00Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"context": {
|
||||
"namespace": "Alexa.EndpointHealth",
|
||||
"name": "connectivity",
|
||||
"value": {
|
||||
"value": "OK"
|
||||
},
|
||||
"timeOfSample": "2019-10-31T16:58:10:00.00Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
}
|
||||
}
|
||||
123
test/fixtures/alexa-docs/alexa-inventorylevelsensor/discovery-addOrUpdateReport.json
vendored
Normal file
123
test/fixtures/alexa-docs/alexa-inventorylevelsensor/discovery-addOrUpdateReport.json
vendored
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa.Discovery",
|
||||
"name": "AddOrUpdateReport",
|
||||
"payloadVersion": "3",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID"
|
||||
},
|
||||
"payload": {
|
||||
"endpoints": [
|
||||
{
|
||||
"endpointId": "Unique ID of the endpoint",
|
||||
"manufacturerName": "Printer Plus",
|
||||
"description": "Smart Printer by Printer Maker Plus",
|
||||
"friendlyName": "Printer",
|
||||
"displayCategories": [
|
||||
"OTHER"
|
||||
],
|
||||
"cookie": {},
|
||||
"capabilities": [
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.InventoryLevelSensor",
|
||||
"instance": "InkSensor.Cyan",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "level"
|
||||
}
|
||||
],
|
||||
"retrievable": true,
|
||||
"proactivelyReported": true
|
||||
},
|
||||
"configuration": {
|
||||
"measurement": {
|
||||
"@type": "Volume",
|
||||
"unit": "MILLILITER"
|
||||
},
|
||||
"replenishment": {
|
||||
"@type": "DashReplenishmentId",
|
||||
"value": "replenishment ID for refill options"
|
||||
}
|
||||
},
|
||||
"capabilityResources": {
|
||||
"friendlyNames": [
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Cyan ink",
|
||||
"locale": "en-US"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Encre cyan",
|
||||
"locale": "fr-FR"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.InventoryLevelSensor",
|
||||
"instance": "PaperSensor.FrontTray",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "level"
|
||||
}
|
||||
],
|
||||
"retrievable": true,
|
||||
"proactivelyReported": true
|
||||
},
|
||||
"configuration": {
|
||||
"measurement": {
|
||||
"@type": "Count"
|
||||
},
|
||||
"replenishment": {
|
||||
"@type": "DashReplenishmentId",
|
||||
"value": "replenishment ID for refill options"
|
||||
}
|
||||
},
|
||||
"capabilityResources": {
|
||||
"friendlyNames": [
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Front tray",
|
||||
"locale": "en-US"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.PowerController",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "powerState"
|
||||
}
|
||||
],
|
||||
"retrievable": true,
|
||||
"proactivelyReported": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa",
|
||||
"version": "3"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
137
test/fixtures/alexa-docs/alexa-inventorylevelsensor/discovery.json
vendored
Normal file
137
test/fixtures/alexa-docs/alexa-inventorylevelsensor/discovery.json
vendored
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
{
|
||||
"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": "Printer Plus",
|
||||
"description": "Smart Printer by Printer Maker Plus",
|
||||
"friendlyName": "Printer",
|
||||
"displayCategories": [
|
||||
"OTHER"
|
||||
],
|
||||
"cookie": {},
|
||||
"capabilities": [
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.InventoryLevelSensor",
|
||||
"instance": "InkSensor.Cyan",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "level"
|
||||
}
|
||||
],
|
||||
"retrievable": false,
|
||||
"proactivelyReported": true
|
||||
},
|
||||
"configuration": {
|
||||
"measurement": {
|
||||
"@type": "Volume",
|
||||
"unit": "MILLILITER"
|
||||
},
|
||||
"replenishment": {
|
||||
"@type": "DashReplenishmentId",
|
||||
"value": "replenishment ID for refill options"
|
||||
}
|
||||
},
|
||||
"capabilityResources": {
|
||||
"friendlyNames": [
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Cyan ink",
|
||||
"locale": "en-US"
|
||||
}
|
||||
},
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Encre cyan",
|
||||
"locale": "fr-FR"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.InventoryLevelSensor",
|
||||
"instance": "PaperSensor.FrontTray",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "level"
|
||||
}
|
||||
],
|
||||
"retrievable": false,
|
||||
"proactivelyReported": true
|
||||
},
|
||||
"configuration": {
|
||||
"measurement": {
|
||||
"@type": "Count"
|
||||
},
|
||||
"replenishment": {
|
||||
"@type": "DashReplenishmentId",
|
||||
"value": "replenishment ID for refill options"
|
||||
}
|
||||
},
|
||||
"capabilityResources": {
|
||||
"friendlyNames": [
|
||||
{
|
||||
"@type": "text",
|
||||
"value": {
|
||||
"text": "Front tray",
|
||||
"locale": "en-US"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.PowerController",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "powerState"
|
||||
}
|
||||
],
|
||||
"retrievable": true,
|
||||
"proactivelyReported": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.EndpointHealth",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "connectivity"
|
||||
}
|
||||
],
|
||||
"proactivelyReported": true,
|
||||
"retrievable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa",
|
||||
"version": "3"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
19
test/fixtures/alexa-docs/alexa-scenecontroller/Activate.directive.json
vendored
Normal file
19
test/fixtures/alexa-docs/alexa-scenecontroller/Activate.directive.json
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"directive": {
|
||||
"header": {
|
||||
"namespace": "Alexa.SceneController",
|
||||
"name": "Activate",
|
||||
"messageId": "Unique version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "endpoint id"
|
||||
},
|
||||
"payload": {}
|
||||
}
|
||||
}
|
||||
25
test/fixtures/alexa-docs/alexa-scenecontroller/ActivationStarted.event.json
vendored
Normal file
25
test/fixtures/alexa-docs/alexa-scenecontroller/ActivationStarted.event.json
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa.SceneController",
|
||||
"name": "ActivationStarted",
|
||||
"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": {
|
||||
"cause": {
|
||||
"type": "VOICE_INTERACTION"
|
||||
},
|
||||
"timestamp": "2017-02-03T16:20:50Z"
|
||||
}
|
||||
},
|
||||
"context": {}
|
||||
}
|
||||
19
test/fixtures/alexa-docs/alexa-scenecontroller/Deactivate.directive.json
vendored
Normal file
19
test/fixtures/alexa-docs/alexa-scenecontroller/Deactivate.directive.json
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"directive": {
|
||||
"header": {
|
||||
"namespace": "Alexa.SceneController",
|
||||
"name": "Deactivate",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2.0 bearer token"
|
||||
},
|
||||
"endpointId": "endpoint id"
|
||||
},
|
||||
"payload": {}
|
||||
}
|
||||
}
|
||||
25
test/fixtures/alexa-docs/alexa-scenecontroller/DeactivationStarted.event.json
vendored
Normal file
25
test/fixtures/alexa-docs/alexa-scenecontroller/DeactivationStarted.event.json
vendored
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa.SceneController",
|
||||
"name": "DeactivationStarted",
|
||||
"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": {
|
||||
"cause": {
|
||||
"type": "VOICE_INTERACTION"
|
||||
},
|
||||
"timestamp": "2017-02-03T16:20:50Z"
|
||||
}
|
||||
},
|
||||
"context": {}
|
||||
}
|
||||
37
test/fixtures/alexa-docs/alexa-scenecontroller/discovery.json
vendored
Normal file
37
test/fixtures/alexa-docs/alexa-scenecontroller/discovery.json
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"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 scene",
|
||||
"manufacturerName": "Sample Vendor",
|
||||
"description": "Party scene by Sample Vendor",
|
||||
"friendlyName": "Living Room Party",
|
||||
"displayCategories": [
|
||||
"SCENE_TRIGGER"
|
||||
],
|
||||
"cookie": {},
|
||||
"capabilities": [
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.SceneController",
|
||||
"version": "3",
|
||||
"supportsDeactivation": false
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa",
|
||||
"version": "3"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
23
test/fixtures/alexa-docs/alexa-simpleeventsource/Event.event.json
vendored
Normal file
23
test/fixtures/alexa-docs/alexa-simpleeventsource/Event.event.json
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa.SimpleEventSource",
|
||||
"name": "Event",
|
||||
"instance": "Unique identifier, preferably a version 4 UUID",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"payloadVersion": "1.0"
|
||||
},
|
||||
"endpoint": {
|
||||
"scope": {
|
||||
"type": "BearerToken",
|
||||
"token": "OAuth2 bearer token"
|
||||
},
|
||||
"endpointId": "Endpoint id",
|
||||
"cookie": {}
|
||||
},
|
||||
"payload": {
|
||||
"id": "Button.SinglePush.1",
|
||||
"timestamp": "2021-12-12T16:20:50.52Z"
|
||||
}
|
||||
}
|
||||
}
|
||||
20
test/fixtures/alexa-docs/alexa-timeholdcontroller/Hold.directive.json
vendored
Normal file
20
test/fixtures/alexa-docs/alexa-timeholdcontroller/Hold.directive.json
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"directive": {
|
||||
"header": {
|
||||
"namespace": "Alexa.TimeHoldController",
|
||||
"name": "Hold",
|
||||
"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": {}
|
||||
}
|
||||
}
|
||||
37
test/fixtures/alexa-docs/alexa-timeholdcontroller/Hold.response.json
vendored
Normal file
37
test/fixtures/alexa-docs/alexa-timeholdcontroller/Hold.response.json
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"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.TimeHoldController",
|
||||
"name": "holdStartTime",
|
||||
"value": "2018-05-31T14:30:00.00Z",
|
||||
"timeOfSample": "2018-05-31T23:30:02.32Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
},
|
||||
{
|
||||
"namespace": "Alexa.TimeHoldController",
|
||||
"name": "holdEndTime",
|
||||
"value": "2018-05-31T14:40:00.00Z",
|
||||
"timeOfSample": "2018-05-31T23:30:02.32Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
20
test/fixtures/alexa-docs/alexa-timeholdcontroller/Resume.directive.json
vendored
Normal file
20
test/fixtures/alexa-docs/alexa-timeholdcontroller/Resume.directive.json
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"directive": {
|
||||
"header": {
|
||||
"namespace": "Alexa.TimeHoldController",
|
||||
"name": "Resume",
|
||||
"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": {}
|
||||
}
|
||||
}
|
||||
20
test/fixtures/alexa-docs/alexa-timeholdcontroller/Resume.response.json
vendored
Normal file
20
test/fixtures/alexa-docs/alexa-timeholdcontroller/Resume.response.json
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"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": {}
|
||||
}
|
||||
37
test/fixtures/alexa-docs/alexa-timeholdcontroller/StateReport.json
vendored
Normal file
37
test/fixtures/alexa-docs/alexa-timeholdcontroller/StateReport.json
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{
|
||||
"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.TimeHoldController",
|
||||
"name": "holdStartTime",
|
||||
"value": "2018-05-31T14:30:00.00Z",
|
||||
"timeOfSample": "2018-08-31T23:30:00Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
},
|
||||
{
|
||||
"namespace": "Alexa.TimeHoldController",
|
||||
"name": "holdEndTime",
|
||||
"value": "2018-05-31T14:40:00.00Z",
|
||||
"timeOfSample": "2018-08-31T23:30:00Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
94
test/fixtures/alexa-docs/alexa-timeholdcontroller/discovery.json
vendored
Normal file
94
test/fixtures/alexa-docs/alexa-timeholdcontroller/discovery.json
vendored
Normal file
|
|
@ -0,0 +1,94 @@
|
|||
{
|
||||
"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 of the endpoint",
|
||||
"description": "Description to be shown in the Alexa app",
|
||||
"friendlyName": "Microwave",
|
||||
"displayCategories": [
|
||||
"MICROWAVE"
|
||||
],
|
||||
"cookie": {},
|
||||
"capabilities": [
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.TimeHoldController",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "holdStartTime"
|
||||
},
|
||||
{
|
||||
"name": "holdEndTime"
|
||||
}
|
||||
],
|
||||
"proactivelyReported": true,
|
||||
"retrievable": true
|
||||
},
|
||||
"configuration": {
|
||||
"allowRemoteResume": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.Cooking",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "cookingMode"
|
||||
},
|
||||
{
|
||||
"name": "foodItem"
|
||||
},
|
||||
{
|
||||
"name": "cookingTimeInterval"
|
||||
}
|
||||
],
|
||||
"proactivelyReported": true,
|
||||
"retrievable": true
|
||||
},
|
||||
"configuration": {
|
||||
"supportsRemoteStart": false,
|
||||
"supportedCookingModes": [
|
||||
"REHEAT",
|
||||
"DEFROST",
|
||||
"PRESET",
|
||||
"OFF"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.EndpointHealth",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "connectivity"
|
||||
}
|
||||
],
|
||||
"proactivelyReported": false,
|
||||
"retrievable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa",
|
||||
"version": "3"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
42
test/fixtures/alexa-docs/alexa-wakeonlancontroller/ChangeReport.json
vendored
Normal file
42
test/fixtures/alexa-docs/alexa-wakeonlancontroller/ChangeReport.json
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"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": "VOICE_INTERACTION"
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"namespace": "Alexa.PowerController",
|
||||
"name": "powerState",
|
||||
"value": "ON",
|
||||
"timeOfSample": "2024-02-03T16:16:00.00Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"context": {
|
||||
"namespace": "Alexa.EndpointHealth",
|
||||
"name": "connectivity",
|
||||
"value": {
|
||||
"value": "OK"
|
||||
},
|
||||
"timeOfSample": "2024-02-03T16:15:00.00Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
}
|
||||
}
|
||||
30
test/fixtures/alexa-docs/alexa-wakeonlancontroller/StateReport.json
vendored
Normal file
30
test/fixtures/alexa-docs/alexa-wakeonlancontroller/StateReport.json
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"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.PowerController",
|
||||
"name": "powerState",
|
||||
"value": "OFF",
|
||||
"timeOfSample": "2017-02-03T16:20:50.52Z",
|
||||
"uncertaintyInMilliseconds": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
14
test/fixtures/alexa-docs/alexa-wakeonlancontroller/TurnOn.deferred.json
vendored
Normal file
14
test/fixtures/alexa-docs/alexa-wakeonlancontroller/TurnOn.deferred.json
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa",
|
||||
"name": "DeferredResponse",
|
||||
"messageId": "Unique identifier, preferably a version 4 UUID",
|
||||
"correlationToken": "Opaque correlation token that matches the request",
|
||||
"payloadVersion": "3"
|
||||
},
|
||||
"payload": {
|
||||
"estimatedDeferralInSeconds": 15
|
||||
}
|
||||
}
|
||||
}
|
||||
20
test/fixtures/alexa-docs/alexa-wakeonlancontroller/TurnOn.directive.json
vendored
Normal file
20
test/fixtures/alexa-docs/alexa-wakeonlancontroller/TurnOn.directive.json
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"directive": {
|
||||
"header": {
|
||||
"namespace": "Alexa.PowerController",
|
||||
"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": {}
|
||||
}
|
||||
}
|
||||
30
test/fixtures/alexa-docs/alexa-wakeonlancontroller/TurnOn.response.json
vendored
Normal file
30
test/fixtures/alexa-docs/alexa-wakeonlancontroller/TurnOn.response.json
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"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.PowerController",
|
||||
"name": "powerState",
|
||||
"value": "ON",
|
||||
"timeOfSample": "2017-02-03T16:20:50.52Z",
|
||||
"uncertaintyInMilliseconds": 500
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
30
test/fixtures/alexa-docs/alexa-wakeonlancontroller/WakeUp.event.json
vendored
Normal file
30
test/fixtures/alexa-docs/alexa-wakeonlancontroller/WakeUp.event.json
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"event": {
|
||||
"header": {
|
||||
"namespace": "Alexa.WakeOnLANController",
|
||||
"name": "WakeUp",
|
||||
"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.PowerController",
|
||||
"name": "powerState",
|
||||
"value": "OFF",
|
||||
"timeOfSample": "2017-02-03T16:20:50.52Z",
|
||||
"uncertaintyInMilliseconds": 500
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
70
test/fixtures/alexa-docs/alexa-wakeonlancontroller/discovery.json
vendored
Normal file
70
test/fixtures/alexa-docs/alexa-wakeonlancontroller/discovery.json
vendored
Normal file
|
|
@ -0,0 +1,70 @@
|
|||
{
|
||||
"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 of the endpoint",
|
||||
"description": "Description to be shown in the Alexa app",
|
||||
"friendlyName": "Device name, displayed in the Alexa app",
|
||||
"displayCategories": [
|
||||
"TV"
|
||||
],
|
||||
"cookie": {},
|
||||
"capabilities": [
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.WakeOnLANController",
|
||||
"version": "3",
|
||||
"properties": {},
|
||||
"configuration": {
|
||||
"MACAddresses": [
|
||||
"00-14-22-01-23-45"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.PowerController",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "powerState"
|
||||
}
|
||||
],
|
||||
"proactivelyReported": true,
|
||||
"retrievable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa.EndpointHealth",
|
||||
"version": "3",
|
||||
"properties": {
|
||||
"supported": [
|
||||
{
|
||||
"name": "connectivity"
|
||||
}
|
||||
],
|
||||
"proactivelyReported": true,
|
||||
"retrievable": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "AlexaInterface",
|
||||
"interface": "Alexa",
|
||||
"version": "3"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
63
test/fixtures/interfaces.js
vendored
63
test/fixtures/interfaces.js
vendored
|
|
@ -14,6 +14,7 @@
|
|||
// unfit [[property, value]]: a value the property does not take
|
||||
// chosen true: a declaration lists the properties the device has, an example some of those of the interface
|
||||
// folded the directives whose example the page folds away, so that it was not saved
|
||||
// endpoint { categories, description } of the endpoint the interface is declared on, where it has rules for them
|
||||
//
|
||||
// A directive is answered with a Response, or with the event responseFor() of its descriptor names.
|
||||
//
|
||||
|
|
@ -61,6 +62,12 @@ module.exports = [
|
|||
unfit: [["colorTemperatureInKelvin", 10001], ["colorTemperatureInKelvin", "warm"]],
|
||||
},
|
||||
{ namespace: "Alexa.ContactSensor", page: "alexa-contactsensor", declared, unfit: [["detectionState", "OPEN"], ["detectionState", true]] },
|
||||
{
|
||||
namespace: "Alexa.DoorbellEventSource",
|
||||
page: "alexa-doorbelleventsource",
|
||||
endpoint: { categories: ["CAMERA", "DOORBELL"] },
|
||||
declared: [{ options: {}, example: "discovery" }],
|
||||
},
|
||||
{ namespace: "Alexa.EndpointHealth", page: "alexa-endpointhealth", declared: [{ options: reported, example: "discovery" }] },
|
||||
{
|
||||
namespace: "Alexa.EqualizerController",
|
||||
|
|
@ -100,6 +107,41 @@ module.exports = [
|
|||
],
|
||||
unfit: [["input", "hdmi 1"], ["input", 1]],
|
||||
},
|
||||
{
|
||||
namespace: "Alexa.InventoryLevelSensor",
|
||||
page: "alexa-inventorylevelsensor",
|
||||
declared: [
|
||||
{
|
||||
example: "discovery",
|
||||
options: {
|
||||
retrievable: false,
|
||||
proactivelyReported: true,
|
||||
instance: "InkSensor.Cyan",
|
||||
friendlyNames: [text("Cyan ink", "en-US"), text("Encre cyan", "fr-FR")],
|
||||
measurement: { "@type": "Volume", unit: "MILLILITER" },
|
||||
replenishment: { "@type": "DashReplenishmentId", value: "replenishment ID for refill options" },
|
||||
},
|
||||
},
|
||||
{
|
||||
example: "discovery",
|
||||
n: 1,
|
||||
options: {
|
||||
retrievable: false,
|
||||
proactivelyReported: true,
|
||||
instance: "PaperSensor.FrontTray",
|
||||
friendlyNames: [text("Front tray", "en-US")],
|
||||
measurement: { "@type": "Count" },
|
||||
replenishment: { "@type": "DashReplenishmentId", value: "replenishment ID for refill options" },
|
||||
},
|
||||
},
|
||||
],
|
||||
unfit: [
|
||||
["level", 5],
|
||||
["level", { "@type": "Volume", value: 5 }],
|
||||
["level", { "@type": "Count", value: 200, unit: "SHEET" }],
|
||||
["level", { "@type": "Length", value: 5, unit: "METER" }],
|
||||
],
|
||||
},
|
||||
{
|
||||
namespace: "Alexa.LockController",
|
||||
page: "alexa-lockcontroller",
|
||||
|
|
@ -175,6 +217,12 @@ module.exports = [
|
|||
},
|
||||
}],
|
||||
},
|
||||
{
|
||||
namespace: "Alexa.SceneController",
|
||||
page: "alexa-scenecontroller",
|
||||
endpoint: { categories: ["SCENE_TRIGGER"], description: "Party scene by Sample Vendor" },
|
||||
declared: [{ options: { supportsDeactivation: false }, example: "discovery" }],
|
||||
},
|
||||
{
|
||||
namespace: "Alexa.SecurityPanelController",
|
||||
page: "alexa-securitypanelcontroller",
|
||||
|
|
@ -196,6 +244,8 @@ module.exports = [
|
|||
],
|
||||
unfit: [["armState", "ARMED"], ["burglaryAlarm", "ALARM"], ["fireAlarm", { value: "FIRE" }]],
|
||||
},
|
||||
// The page folds its discovery example away
|
||||
{ namespace: "Alexa.SimpleEventSource", page: "alexa-simpleeventsource", declared: [] },
|
||||
{
|
||||
namespace: "Alexa.Speaker",
|
||||
page: "alexa-speaker",
|
||||
|
|
@ -270,6 +320,14 @@ module.exports = [
|
|||
],
|
||||
unfit: [["scheduleEnabled", "ON"], ["adaptiveRecoveryEnabled", 1]],
|
||||
},
|
||||
{
|
||||
// The ChangeReport example of the page reports "2018-05-31T14:02.32Z", which is no time: it was not saved
|
||||
namespace: "Alexa.TimeHoldController",
|
||||
page: "alexa-timeholdcontroller",
|
||||
declared: [{ options: { ...reported, allowRemoteResume: true }, example: "discovery" }],
|
||||
refused: [["Hold", 10, "payload: expected an object, got 10"]],
|
||||
unfit: [["holdStartTime", "14:30"], ["holdEndTime", "2018-05-31T14:40:00+02:00"]],
|
||||
},
|
||||
{
|
||||
namespace: "Alexa.ToggleController",
|
||||
page: "alexa-togglecontroller",
|
||||
|
|
@ -314,4 +372,9 @@ module.exports = [
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
namespace: "Alexa.WakeOnLANController",
|
||||
page: "alexa-wakeonlancontroller",
|
||||
declared: [{ options: { macAddresses: ["00-14-22-01-23-45"] }, example: "discovery" }],
|
||||
},
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue