* Toggles the FastLED animation loop * @returns {Promise } Promise that resolves to running state (true if now running)
()
| 1054 | * @returns {Promise<boolean>} Promise that resolves to running state (true if now running) |
| 1055 | */ |
| 1056 | async function toggleFastLED() { |
| 1057 | if (!fastLEDController) { |
| 1058 | console.error('FastLED controller not initialized'); |
| 1059 | return false; |
| 1060 | } |
| 1061 | |
| 1062 | if (fastLEDController.running) { |
| 1063 | await fastLEDController.stopWithWorkerSupport(); |
| 1064 | return false; |
| 1065 | } else { |
| 1066 | await fastLEDController.startWithWorkerSupport(); |
| 1067 | return true; |
| 1068 | } |
| 1069 | } |
| 1070 | |
| 1071 | /** |
| 1072 | * Sets up global error handlers for unhandled promise rejections |
no test coverage detected