Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
// many devices seem to call this on start up or on switching to a new network
API["tuya.device.upgrade.silent.get"] = params => {
if( ids.includes(params.gwId) || !ids.length )
return {
"url": upgrade.url,
"type": 0,
"size": upgrade.size,
"md5": upgrade.md5,
"version": upgrade.version
}
}
// some devices call this to upgrade firmware when protocol 15 comes over mqtt
API["s.gw.upgrade"] = params => {
return {
"auto": true,
"url": upgrade.url,
"size": upgrade.size,
"fileSize": upgrade.size,
"md5": upgrade.md5,
"version": upgrade.version
}
}
// other devices call this to upgrade firmware when protocol 15 comes over mqtt
API["tuya.device.upgrade.get"] = params => {
return {
"size": upgrade.size,
"cdnUrl": upgrade.url,
"originalUrl": upgrade.url,