create.yaml 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. - device_type
  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. device_type:
  34. type: string
  35. description: Type of the device to add
  36. example: on_off_switch
  37. enum:
  38. - on_off_switch
  39. responses:
  40. "200":
  41. description: Device created
  42. content:
  43. application/json:
  44. schema:
  45. $ref: "#/components/schemas/Device"
  46. "400":
  47. $ref: "#/components/responses/400"
  48. "401":
  49. $ref: "#/components/responses/401"
  50. "403":
  51. $ref: "#/components/responses/403"
  52. "404":
  53. $ref: "#/components/responses/404"
  54. "500":
  55. $ref: "#/components/responses/500"