-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added the /resource/temperature API (#19)
- Loading branch information
Showing
5 changed files
with
201 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
type: object | ||
allOf: | ||
- $ref: '../../common/ResourceOwned.yaml' | ||
- type: object | ||
properties: | ||
enabled: | ||
type: boolean | ||
description: | | ||
`true` when sensor is activated, `false` when deactivated | ||
temperature: | ||
type: object | ||
properties: | ||
temperature: | ||
type: number | ||
description: Deprecated. Moved to Temperature_report/temperature | ||
example: 23 | ||
temperature_valid: | ||
type: boolean | ||
description: Deprecated. Indication whether the value presented in temperature is valid | ||
temperature_report: | ||
type: object | ||
properties: | ||
changed: | ||
type: string | ||
format: date-time | ||
description: last time the value of this property is changed. | ||
temperature: | ||
type: number | ||
description: Temperature in 1.00 degrees Celsius | ||
example: 23 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
type: object | ||
properties: | ||
type: | ||
type: string | ||
description: Type of the supported resources (always `temperature` here) | ||
enum: | ||
- temperature | ||
enabled: | ||
type: boolean | ||
description: true when sensor is activated, false when deactivated |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
get: | ||
operationId: getTemperatures | ||
summary: List temperatures | ||
description: List all temperatures | ||
tags: | ||
- Temperature | ||
security: | ||
- HueApplicationKey: [ ] | ||
responses: | ||
200: | ||
description: Temperature Success Response | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: '../common/ApiResponse.yaml' | ||
- type: object | ||
properties: | ||
data: | ||
type: array | ||
items: | ||
$ref: './schemas/TemperatureGet.yaml' | ||
401: | ||
$ref: '../common/error.yaml#/components/responses/Unauthorized' | ||
403: | ||
$ref: '../common/error.yaml#/components/responses/Forbidden' | ||
404: | ||
$ref: '../common/error.yaml#/components/responses/NotFound' | ||
405: | ||
$ref: '../common/error.yaml#/components/responses/MethodNotAllowed' | ||
406: | ||
$ref: '../common/error.yaml#/components/responses/NotAcceptable' | ||
409: | ||
$ref: '../common/error.yaml#/components/responses/Conflict' | ||
429: | ||
$ref: '../common/error.yaml#/components/responses/TooManyRequests' | ||
500: | ||
$ref: '../common/error.yaml#/components/responses/InternalServerError' | ||
503: | ||
$ref: '../common/error.yaml#/components/responses/ServiceUnavailable' | ||
507: | ||
$ref: '../common/error.yaml#/components/responses/InsufficientStorage' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
get: | ||
operationId: getTemperature | ||
summary: Get temperature sensor information | ||
description: Get details of a single temperature sensor from its given `{temperatureId}`. | ||
tags: | ||
- Temperature | ||
security: | ||
- HueApplicationKey: [ ] | ||
parameters: | ||
- name: temperatureId | ||
in: path | ||
schema: | ||
type: string | ||
required: true | ||
description: ID of the temperature sensor | ||
responses: | ||
200: | ||
description: Temperature Success Response | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: '../common/ApiResponse.yaml' | ||
- type: object | ||
properties: | ||
data: | ||
type: array | ||
items: | ||
$ref: './schemas/TemperatureGet.yaml' | ||
401: | ||
$ref: '../common/error.yaml#/components/responses/Unauthorized' | ||
403: | ||
$ref: '../common/error.yaml#/components/responses/Forbidden' | ||
404: | ||
$ref: '../common/error.yaml#/components/responses/NotFound' | ||
405: | ||
$ref: '../common/error.yaml#/components/responses/MethodNotAllowed' | ||
406: | ||
$ref: '../common/error.yaml#/components/responses/NotAcceptable' | ||
409: | ||
$ref: '../common/error.yaml#/components/responses/Conflict' | ||
429: | ||
$ref: '../common/error.yaml#/components/responses/TooManyRequests' | ||
500: | ||
$ref: '../common/error.yaml#/components/responses/InternalServerError' | ||
503: | ||
$ref: '../common/error.yaml#/components/responses/ServiceUnavailable' | ||
507: | ||
$ref: '../common/error.yaml#/components/responses/InsufficientStorage' | ||
put: | ||
operationId: updateTemperature | ||
summary: Update temperature sensor | ||
description: Update a temperature sensor from its given `{temperatureId}`. | ||
tags: | ||
- Temperature | ||
security: | ||
- HueApplicationKey: [ ] | ||
parameters: | ||
- name: temperatureId | ||
in: path | ||
schema: | ||
type: string | ||
required: true | ||
description: ID of the temperature sensor | ||
requestBody: | ||
content: | ||
application/json: | ||
examples: | ||
Enable: | ||
summary: Enable temperature sensor | ||
value: | ||
enabled: true | ||
Disable: | ||
summary: Disable temperature sensor | ||
value: | ||
enabled: false | ||
schema: | ||
$ref: './schemas/TemperaturePut.yaml' | ||
responses: | ||
200: | ||
description: Success | ||
content: | ||
application/json: | ||
schema: | ||
allOf: | ||
- $ref: '../common/ApiResponse.yaml' | ||
- type: object | ||
properties: | ||
data: | ||
type: array | ||
items: | ||
$ref: '../common/ResourceIdentifier.yaml' | ||
401: | ||
$ref: '../common/error.yaml#/components/responses/Unauthorized' | ||
403: | ||
$ref: '../common/error.yaml#/components/responses/Forbidden' | ||
404: | ||
$ref: '../common/error.yaml#/components/responses/NotFound' | ||
405: | ||
$ref: '../common/error.yaml#/components/responses/MethodNotAllowed' | ||
406: | ||
$ref: '../common/error.yaml#/components/responses/NotAcceptable' | ||
409: | ||
$ref: '../common/error.yaml#/components/responses/Conflict' | ||
429: | ||
$ref: '../common/error.yaml#/components/responses/TooManyRequests' | ||
500: | ||
$ref: '../common/error.yaml#/components/responses/InternalServerError' | ||
503: | ||
$ref: '../common/error.yaml#/components/responses/ServiceUnavailable' | ||
507: | ||
$ref: '../common/error.yaml#/components/responses/InsufficientStorage' |