You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: correct web API off endpoints and add blink task cancellation
Two issues fixed:
1. **Off endpoints not working**: The BusylightAPI.off() method was marked as
async but called synchronous controller methods, causing await calls to fail.
- Removed async from BusylightAPI.off() method
- Removed await calls from off endpoints and startup/shutdown handlers
2. **Blink tasks not being canceled**: The turn_off() method only called
light.off() but didn't cancel running tasks like blink effects.
- Added light.cancel_tasks() before light.off() in turn_off() method
- Added proper error handling for lights without task support
Fixed endpoints:
- GET /light/{light_id}/off - now properly turns off individual lights
- GET /lights/off - now properly turns off all lights
- Startup/shutdown handlers - now work without async issues
The off endpoints should now work and properly cancel any running blink tasks.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
0 commit comments