signal.yaml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. operationId: deviceSignal
  2. summary: Send Signal
  3. security:
  4. - UserAuth: []
  5. description: Send a signal to a device to control it
  6. tags: [Device]
  7. parameters:
  8. - name: home_id
  9. in: path
  10. description: ID of the home the device belongs to
  11. required: true
  12. schema:
  13. type: string
  14. format: uuid
  15. example: 019e1d64-6ad9-71e8-a976-ae99ad44c678
  16. - name: device_id
  17. in: path
  18. description: ID of the device
  19. required: true
  20. schema:
  21. type: string
  22. format: uuid
  23. example: 019e1d65-01ad-78b0-a70a-7200523c548f
  24. requestBody:
  25. content:
  26. application/json:
  27. schema:
  28. type: object
  29. required:
  30. - device_type
  31. - signal
  32. properties:
  33. device_type:
  34. type: string
  35. description: Type of the device
  36. example: on_off_switch
  37. enum:
  38. - on_off_switch
  39. signal:
  40. description: Command to send (must match device_type)
  41. oneOf:
  42. - type: string
  43. description: on_off_switch
  44. enum:
  45. - on
  46. - off
  47. responses:
  48. "200":
  49. description: "Signal success (always returns '{success: true}')"
  50. content:
  51. application/json:
  52. schema:
  53. type: object
  54. properties:
  55. success:
  56. type: boolean
  57. "400":
  58. $ref: "#/components/responses/400"
  59. "401":
  60. $ref: "#/components/responses/401"
  61. "403":
  62. $ref: "#/components/responses/403"
  63. "404":
  64. $ref: "#/components/responses/404"
  65. "500":
  66. $ref: "#/components/responses/500"