-
Notifications
You must be signed in to change notification settings - Fork 1
API Descriptions: Lamp
Alexey Andreyev edited this page Oct 14, 2016
·
29 revisions
Below bodies of responses to requests to the given URLs are presented, including the .well-known/core URL.
{
"@context": [
"https://w3id.org/semiot/device/commoncontext#",
{ "doc": "http://external/doc#" }
],
"@id": "doc:ApiDocumentation",
"@type": "ApiDocumentation",
"supportedClass": [
{
"@id": "doc:LampDevice",
"subClassOf": "Device",
"supportedProperty": [{
"property": "location",
"writable": "true",
"label": { "@value": "Location", "@language": "en" }
},
{
"property": "label",
"writable": "false",
"label": { "@value": "Label", "@language": "en" }
}],
"supportedOperation": {
"method": "PUT",
"expects": "doc:LampDevice",
"returns": "doc:LampDevice"
}
},
{
"@id": "doc:shineAction",
"@type": "Link",
"range": "ControlAction",
"supportedOperation": [{
"method": "GET",
"returns": "ControlAction"
},
{
"method": "POST",
"expects": "doc:TurnOnAction"
},
{
"method": "POST",
"expects": "doc:TurnOffAction"
}]
},
{
"@id": "doc:TurnOnAction",
"subClassOf": "ControlAction",
"label": { "@value": "Turn on", "@language": "en" },
"supportedProperty": {
"@type": "PropertyValueSpecification",
"property": "doc:brightness",
"label": { "@value": "Brightness", "@language": "en" },
"valueRequired": false,
"defaultValue": 50.0,
"minValue": 0.0,
"maxValue": 100.0
}
},
{
"@id": "doc:TurnOffAction",
"subClassOf": "ControlAction",
"label": { "@value": "Turn off", "@language": "en" }
},
{
"@id": "doc:LampConfiguration",
"subClassOf": "DeviceConfiguration",
"supportedProperty": [
{
"label": "Wi-Fi Name",
"property": "doc:wifiName",
"valueRequired": true,
"writable": true
},
{
"label": "Wi-Fi Password",
"property": "doc:wifiPassword",
"valueRequired": true,
"writable": true
},
{
"label": "Auth username",
"property": "doc:username",
"valueRequired": true,
"writable": true
},
{
"label": "Auth password",
"property": "doc:password",
"valueRequired": true,
"writable": true
},
{
"label": "Device Name",
"property": "doc:deviceName",
"valueRequired": true,
"writable": true
}
]
}
]
}
-
/-
rt=http://schema.org/EntryPoint
-
{
"@context": "http://external/doc#",
"@id": "coap://1.1.1.1/",
"@type": "LampDevice",
"label": { "@value": "Lamp #1010", "@language": "en" }
"identifier": "e9704",
"location": {
"@type": "Place",
"label": "1010"
},
"shineAction": "/shine"
}
{
"@context": "http://external/doc#",
"@type": "LampDevice",
"location": {
"@type": "Place",
"label": "301"
}
}
{
"@context": "http://external/doc#",
"@type": "TurnOff",
"actionStatus": "CompletedActionStatus"
}
{
"@context": "http://external/doc#",
"@type": "TurnOn",
"actionStatus": "CompletedActionStatus",
"brightness": 73
}
{
"@context": "http://external/doc#",
"@type": "TurnOffAction"
}
{
"@context": "http://external/doc#",
"@type": "TurnOnAction",
"brightness": 73
}
{
"@context": "http://external/doc#",
"@id": "/config",
"@type": "Configuration",
"wifiName": "ISST",
"wifiPassword": "ISSTpassword",
"username": "superuser",
"password": "strongpass",
"deviceName": "My Device"
}