diff --git a/Services/data/devicemodels/scripts/FirmwareUpdate-method.js b/Services/data/devicemodels/scripts/FirmwareUpdate-method.js index a44ded61..9afe93f1 100644 --- a/Services/data/devicemodels/scripts/FirmwareUpdate-method.js +++ b/Services/data/devicemodels/scripts/FirmwareUpdate-method.js @@ -16,7 +16,7 @@ var state = { // Default device properties var properties = { Firmware: "1.0.0", - DeviceMethodStatus: "Updating Firmware" + FirmwareUpdateStatus: "Updating Firmware" }; /** @@ -58,7 +58,7 @@ function main(context, previousState, previousProperties) { // Reboot - devices goes offline and comes online after 20 seconds log("Executing 'FirmwareUpdate' JavaScript method; Firmware version passed:" + context.Firmware); - var DeviceMethodStatusKey = "DeviceMethodStatus"; + var DevicePropertyKey = "FirmwareUpdateStatus"; var FirmwareKey = "Firmware"; // update the status to offline & firmware updating @@ -66,25 +66,25 @@ function main(context, previousState, previousProperties) { state.CalculateRandomizedTelemetry = false; var status = "Command received, updating firmware version to "; status = status.concat(context.Firmware); - updateProperty(DeviceMethodStatusKey, status); + updateProperty(DevicePropertyKey, status); sleep(5000); log("Image Downloading..."); status = "Image Downloading..."; - updateProperty(DeviceMethodStatusKey, status); + updateProperty(DevicePropertyKey, status); sleep(7500); log("Executing firmware update simulation function, firmware version passed:" + context.Firmware); status = "Downloaded, applying firmware..."; - updateProperty(DeviceMethodStatusKey, status); + updateProperty(DevicePropertyKey, status); sleep(5000); status = "Rebooting..."; - updateProperty(DeviceMethodStatusKey, status); + updateProperty(DevicePropertyKey, status); sleep(5000); status = "Firmware Updated."; - updateProperty(DeviceMethodStatusKey, status); + updateProperty(DevicePropertyKey, status); properties.Firmware = context.Firmware; updateProperty(FirmwareKey, context.Firmware); sleep(7500);