create.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. properties:
  24. name:
  25. type: string
  26. description: Name of the device exactly matching the device on Zigbee2MQTT
  27. example: north_bedroom_light
  28. description:
  29. type: string
  30. description: Short user created description of the device
  31. example: North Bedroom Light
  32. responses:
  33. "200":
  34. description: Device created
  35. content:
  36. application/json:
  37. schema:
  38. $ref: "#/components/schemas/Device"
  39. "400":
  40. $ref: "#/components/responses/400"
  41. "401":
  42. $ref: "#/components/responses/401"
  43. "403":
  44. $ref: "#/components/responses/403"
  45. "404":
  46. $ref: "#/components/responses/404"
  47. "500":
  48. $ref: "#/components/responses/500"