|
|
@@ -0,0 +1,50 @@
|
|
|
+operationId: deviceCreate
|
|
|
+summary: Create
|
|
|
+security:
|
|
|
+ - UserAuth: []
|
|
|
+description: Create a new device for a home
|
|
|
+tags: [Device]
|
|
|
+parameters:
|
|
|
+ - name: home_id
|
|
|
+ in: path
|
|
|
+ description: ID of home to add device to
|
|
|
+ required: true
|
|
|
+ schema:
|
|
|
+ type: string
|
|
|
+ format: uuid
|
|
|
+ example: 019e1850-db33-7893-8cc0-61965e39e9bd
|
|
|
+requestBody:
|
|
|
+ content:
|
|
|
+ application/json:
|
|
|
+ schema:
|
|
|
+ type: object
|
|
|
+ required:
|
|
|
+ - name
|
|
|
+ - description
|
|
|
+ properties:
|
|
|
+ name:
|
|
|
+ type: string
|
|
|
+ description: Name of the device exactly matching the device on Zigbee2MQTT
|
|
|
+ example: north_bedroom_light
|
|
|
+ description:
|
|
|
+ type: string
|
|
|
+ description: Short user created description of the device
|
|
|
+ example: North Bedroom Light
|
|
|
+
|
|
|
+responses:
|
|
|
+ "200":
|
|
|
+ description: Device created
|
|
|
+ content:
|
|
|
+ application/json:
|
|
|
+ schema:
|
|
|
+ $ref: "#/components/schemas/Device"
|
|
|
+ "400":
|
|
|
+ $ref: "#/components/responses/400"
|
|
|
+ "401":
|
|
|
+ $ref: "#/components/responses/401"
|
|
|
+ "403":
|
|
|
+ $ref: "#/components/responses/403"
|
|
|
+ "404":
|
|
|
+ $ref: "#/components/responses/404"
|
|
|
+ "500":
|
|
|
+ $ref: "#/components/responses/500"
|