mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
add test data for checkUpgrade action
This commit is contained in:
@@ -197,12 +197,20 @@ function custom_support() {
|
|||||||
|
|
||||||
// called by Action endpoint
|
// called by Action endpoint
|
||||||
function check_upgrade(version: string) {
|
function check_upgrade(version: string) {
|
||||||
console.log('check upgrade from version', version);
|
let data = {};
|
||||||
const data = {
|
if (version) {
|
||||||
emsesp_version: VERSION,
|
console.log('check upgrade from version', version);
|
||||||
upgradeable: true
|
data = {
|
||||||
// upgradeable: false,
|
emsesp_version: VERSION,
|
||||||
};
|
upgradeable: true
|
||||||
|
// upgradeable: false,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
console.log('requesting ems-esp version');
|
||||||
|
data = {
|
||||||
|
emsesp_version: VERSION
|
||||||
|
};
|
||||||
|
}
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4822,6 +4830,10 @@ router
|
|||||||
return custom_support();
|
return custom_support();
|
||||||
} else if (action === 'checkUpgrade') {
|
} else if (action === 'checkUpgrade') {
|
||||||
// check upgrade
|
// check upgrade
|
||||||
|
// check if content has a param
|
||||||
|
if (!content.param) {
|
||||||
|
return check_upgrade('');
|
||||||
|
}
|
||||||
return check_upgrade(content.param);
|
return check_upgrade(content.param);
|
||||||
} else if (action === 'uploadURL') {
|
} else if (action === 'uploadURL') {
|
||||||
// upload URL
|
// upload URL
|
||||||
|
|||||||
Reference in New Issue
Block a user