-
Notifications
You must be signed in to change notification settings - Fork 131
Closed
Description
When forcing an OTA update from the SinricPro portal, the payload correctly contains "forceUpdate": true, but the library always evaluates it as false.
Example payload received from the portal (note "forceUpdate": true):
{
"header": {
"payloadVersion": 2,
"signatureVersion": 1
},
"payload": {
"action": "otaUpdateAvailable",
"clientId": "portal",
"createdAt": 1758286756,
"replyToken": "1248a0ff-8555-4889-bf5b-922876cada99",
"scope": "module",
"type": "request",
"value": {
"forceUpdate": true,
"url": "https://otaupdates.sinric.pro/download?...",
"version": {
"major": 1,
"minor": 1,
"patch": 2
}
}
},
"signature": {
"HMAC": "feTLQw5tvtR3rI6EtSrkMs+9plJqafPSpemDIDXJJes="
}
}
The issue is located in src/SinricProModuleCommandHandler.h line 75:
bool forceUpdate = request.request_value[FSTR_OTA_version][FSTR_OTA_forceUpdate] | false;
Because of the extra [FSTR_OTA_version], the forceUpdate flag is never correctly read and always evaluates to false.
Correct code should be:
bool forceUpdate = request.request_value[FSTR_OTA_forceUpdate] | false;
Environment:
PlatformIO
SinricPro v3.5.0
kakopappa
Metadata
Metadata
Assignees
Labels
No labels