Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WakeOnLANController #157

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions sample_messages/Discovery/Discovery.response.json
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,55 @@
}
}
]
},
{
"endpointId": "endpoint-010",
"manufacturerName": "Sample Manufacturer",
"friendlyName": "Computer",
"description": "010 Computer that need Wake On LAN to turn on",
"displayCategories": [
"COMPUTER"
],
"connections": [
{
"type": "TCP_IP",
"macAddress": "00:11:22:AA:BB:33"
}
],
"cookie": {
"detail1": "For simplicity, this is computer have only",
"detail2": "information to make possible wake on lan."
},
"capabilities": [
{
"type": "AlexaInterface",
"interface": "Alexa",
"version": "3"
},
{
"type": "AlexaInterface",
"interface": "Alexa.WakeOnLANController",
"version": "3",
"properties": {},
"configuration": {
"MACAddresses": ["00:11:22:AA:BB:33"]
}
},
{
"type": "AlexaInterface",
"interface": "Alexa.PowerController",
"version": "3",
"properties": {
"supported": [
{
"name": "powerState"
}
],
"proactivelyReported": true,
"retrievable": true
}
}
]
}
]
}
Expand Down
14 changes: 14 additions & 0 deletions sample_messages/WakeOnLANController/DeferredResponse.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"event": {
"header": {
"namespace": "Alexa",
"name": "DeferredResponse",
"payloadVersion": "3",
"messageId": "5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4",
"correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg=="
},
"payload": {
"estimatedDeferralInSeconds": 20
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"directive": {
"header": {
"namespace": "Alexa.PowerController",
"name": "TurnOn",
"payloadVersion": "3",
"messageId": "1bd5d003-31b9-476f-ad03-71d471922820",
"correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg=="
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "access-token-from-skill"
},
"endpointId": "endpoint-001",
"cookie": {}
},
"payload": {}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
POST /v3/events HTTP/1.1
Host: api.amazonalexa.com
Authorization: Bearer access-token-from-Amazon
Content-Type: application/json

{
"event": {
"header": {
"namespace": "Alexa",
"name": "Response",
"messageId": "2e2c312f-20c3-44ff-cc91-23bb133e5553",
"correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg==",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "access-token-from-Amazon"
},
"endpointId": "endpoint-010"
},
"payload": {}
},
"context": {
"properties": [
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": "ON",
"timeOfSample": "2020-06-15T01:59:50.52Z",
"uncertaintyInMilliseconds": 500
}
]
}
}
35 changes: 35 additions & 0 deletions sample_messages/WakeOnLANController/WakeUp.event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
POST /v3/events HTTP/1.1
Host: api.amazonalexa.com
Authorization: Bearer access-token-from-Amazon
Content-Type: application/json

{
"event": {
"header": {
"namespace": "Alexa.WakeOnLANController",
"name": "WakeUp",
"messageId": "3e1b246e-10f3-3ff3-7c99-32aa123f43c3",
"correlationToken": "dFMb0z+PgpgdDmluhJ1LddFvSqZ/jCc8ptlAKulUj90jSqg==",
"payloadVersion": "3"
},
"endpoint": {
"scope": {
"type": "BearerToken",
"token": "access-token-from-Amazon"
},
"endpointId": "endpoint-010"
},
"payload": {}
},
"context": {
"properties": [
{
"namespace": "Alexa.PowerController",
"name": "powerState",
"value": "OFF",
"timeOfSample": "2020-06-15T01:50:50.52Z",
"uncertaintyInMilliseconds": 500
}
]
}
}
1 change: 1 addition & 0 deletions validation_schemas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,5 @@ Alexa.Speaker
Alexa.TemperatureSensor
Alexa.ThermostatController
Alexa.ToggleController
Alexa.WakeOnLANController
```
169 changes: 169 additions & 0 deletions validation_schemas/alexa_smart_home_message_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2196,6 +2196,95 @@
}
]
},
{
"type": "object",
"allOf": [
{
"required": [
"interface",
"type",
"version",
"configuration",
],
"type": "object",
"properties": {
"type": {
"pattern": "^[ a-zA-Z0-9_\\-=#;:?@&]+$",
"type": "string"
},
"interface": {
"type": "string"
},
"version": {
"oneOf": [
{
"type": "string"
},
{
"type": "number"
}
]
},
"configuration": {
"type": "object",
"required": [
"MACAddresses",
],
"additionalProperties": false,
"properties": {
"MACAddresses": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"pattern": "^[0-9A-Fa-f:]+$",
"type": "string"
}
}
}
},
"properties": {
"type": "object",
"additionalProperties": false
}
}
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"AlexaInterface"
]
},
"interface": {
"type": "string",
"enum": [
"Alexa.WakeOnLANController"
]
},
"version": {
"oneOf": [
{
"type": "string",
"enum": [
"3"
]
},
{
"type": "integer",
"format": "int32",
"enum": [
3
]
}
]
}
}
}
]
},
{
"type": "object",
"allOf": [
Expand Down Expand Up @@ -8284,6 +8373,86 @@
}
}
},
{
"description": "A WakeUp event for Alexa event gateway",
"type": "object",
"required": [
"event"
],
"additionalProperties": false,
"properties": {
"context": {
"$ref": "#/definitions/common/model.Context"
},
"event": {
"type": "object",
"required": [
"header",
"endpoint",
"payload"
],
"additionalProperties": false,
"properties": {
"header": {
"type": "object",
"required": [
"namespace",
"name",
"payloadVersion",
"messageId",
"correlationalToken"
],
"additionalProperties": false,
"properties": {
"namespace": {
"type": "string",
"enum": [
"Alexa.WakeOnLANController"
]
},
"name": {
"type": "string",
"enum": [
"WakeUp"
]
},
"payloadVersion": {
"$ref": "#/definitions/common/model.PayloadVersion"
},
"messageId": {
"$ref": "#/definitions/common/model.MessageId"
},
"correlationToken": {
"$ref": "#/definitions/common/model.CorrelationToken"
}
}
},
"endpoint": {
"type": "object",
"required": [
"scope",
"endpointId"
],
"additionalProperties": false,
"properties": {
"scope": {
"$ref": "#/definitions/common/model.Scope"
},
"endpointId": {
"$ref": "#/definitions/common/model.EndpointId"
}
}
},
"payload": {
"type": "object",
"properties": {
},
"additionalProperties": false
}
}
}
}
},
{
"description": "A DeferredResponse message for Alexa",
"type": "object",
Expand Down