Reorder blink related endpoints for performance purpose
This commit is contained in:
@@ -177,6 +177,12 @@ async def __blinkTask(color, brightness, frequency, duration):
|
||||
__setBusyLightColor(color, brightness)
|
||||
blStatus = blPreviousStatus
|
||||
|
||||
@app.post('/api/blink/stop')
|
||||
async def blinkStop(request):
|
||||
global blBlinking
|
||||
blBlinking = False
|
||||
return {'status': blStatus}
|
||||
|
||||
@app.post('/api/blink')
|
||||
async def setBlink(request):
|
||||
frequency = request.json.get('frequency')
|
||||
@@ -226,12 +232,6 @@ async def getBlink(request):
|
||||
'remains': remains
|
||||
}
|
||||
|
||||
@app.post('/api/blink/stop')
|
||||
async def blinkStop(request):
|
||||
global blBlinking
|
||||
blBlinking = False
|
||||
return {'status': blStatus}
|
||||
|
||||
@app.get('/api/color')
|
||||
async def getColor(request):
|
||||
r, g, b = neoPixelStrip.__getitem__(0)
|
||||
|
||||
Reference in New Issue
Block a user