create.yaml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. operationId: deviceCreate
  2. summary: Create
  3. security:
  4. - UserAuth: []
  5. description: Create a new device for a home
  6. tags: [Device]
  7. parameters:
  8. - name: home_id
  9. in: path
  10. description: ID of home to add device to
  11. required: true
  12. schema:
  13. type: string
  14. format: uuid
  15. example: 019e1850-db33-7893-8cc0-61965e39e9bd
  16. requestBody:
  17. content:
  18. application/json:
  19. schema:
  20. type: object
  21. required:
  22. - name
  23. - description
  24. properties:
  25. name:
  26. type: string
  27. description: Name of the device exactly matching the device on Zigbee2MQTT
  28. example: north_bedroom_light
  29. description:
  30. type: string
  31. description: Short user created description of the device
  32. example: North Bedroom Light
  33. responses:
  34. "200":
  35. description: Device created
  36. content:
  37. application/json:
  38. schema:
  39. $ref: "#/components/schemas/Device"
  40. "400":
  41. $ref: "#/components/responses/400"
  42. "401":
  43. $ref: "#/components/responses/401"
  44. "403":
  45. $ref: "#/components/responses/403"
  46. "404":
  47. $ref: "#/components/responses/404"
  48. "500":
  49. $ref: "#/components/responses/500"