How to use the s.gw.upgrade function in s

To help you get started, we’ve selected a few s examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kueblc / mocktuyacloud / index.js View on Github external
}

// 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,

s

SheetJS Spreadsheet Helper Library

Apache-2.0
Latest version published 5 years ago

Package Health Score

56 / 100
Full package analysis