action_config.c 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. #ifdef ACTION_ENABLED
  2. #define TOTAL_ACTION_COUNTS (1)
  3. static TYPE_DEF_TEMPLATE_INT sg_light_blink_in_time = 0;
  4. static TYPE_DEF_TEMPLATE_BOOL sg_light_blink_in_color = 0;
  5. static TYPE_DEF_TEMPLATE_INT sg_light_blink_in_total_time = 0;
  6. static DeviceProperty g_actionInput_light_blink[] = {
  7. {.key = "time", .data = &sg_light_blink_in_time, .type = TYPE_TEMPLATE_INT},
  8. {.key = "color", .data = &sg_light_blink_in_color, .type = TYPE_TEMPLATE_BOOL},
  9. {.key = "total_time", .data = &sg_light_blink_in_total_time, .type = TYPE_TEMPLATE_INT},
  10. };
  11. static TYPE_DEF_TEMPLATE_BOOL sg_light_blink_out_err_code = 0;
  12. static DeviceProperty g_actionOutput_light_blink[] = {
  13. {.key = "err_code", .data = &sg_light_blink_out_err_code, .type = TYPE_TEMPLATE_BOOL},
  14. };
  15. static DeviceAction g_actions[] = {
  16. {
  17. .pActionId = "light_blink",
  18. .timestamp = 0,
  19. .input_num = sizeof(g_actionInput_light_blink) / sizeof(g_actionInput_light_blink[0]),
  20. .output_num = sizeof(g_actionOutput_light_blink) / sizeof(g_actionOutput_light_blink[0]),
  21. .pInput = g_actionInput_light_blink,
  22. .pOutput = g_actionOutput_light_blink,
  23. },
  24. };
  25. #endif