{ "widgetsBundle": { "alias": "ota_for_esp32_widget22", "title": "OTA widgets", "image": null }, "widgetTypes": [ { "alias": "esp32", "name": "ESP32_OTA_widget", "descriptor": { "type": "latest", "sizeX": 7, "sizeY": 4, "resources": [], "templateHtml": "
", "templateCss": ".ota-config-form {\r\n overflow: hidden; \r\n height: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n.shared-attr-container {\r\n margin-top: 20px;\r\n display: flex;\r\n flex-direction: column;\r\n}\r\n\r\n.attr-input {\r\n font-size: 13px;\r\n margin: 0 15px;\r\n}\r\n\r\ninput {\r\n font-size: 13px;\r\n}\r\n\r\n.start-ota {\r\n font-size: 13px;\r\n margin: 0 15px;\r\n display: flex;\r\n justify-content: flex-start;\r\n}\r\n\r\nmd-toast{\r\n min-width: 0;\r\n}\r\nmd-toast .md-toast-content {\r\n font-size: 13px!important;\r\n}\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n", "controllerScript": "let attributeService;\nlet toast;\nlet types;\nlet utils;\nlet settings;\nlet datasource;\nlet subscription;\n\nself.onInit = function () {\n $scope = self.ctx.$scope;\n toast = $scope.$injector.get('toast');\n types = $scope.$injector.get('types');\n utils = $scope.$injector.get('utils');\n settings = angular.copy(self.ctx.settings) || {};\n datasource = self.ctx.datasources[0];\n subscription = self.ctx.defaultSubscription;\n $scope.settings = settings;\n \n attributeService = $scope.$injector.get('attributeService');\n $scope.updateOtaConfig = updateOtaConfig;\n\n $scope.activeVal = false;\n $scope.fwStateVal = undefined;\n $scope.currentFwVal = undefined;\n $scope.lastTargetFwVer = undefined;\n $scope.lastTargetFwUrl = undefined;\n $scope.lastOtaStartedOn = undefined;\n};\n\nself.onDataUpdated = function () {\n for (let i=0;i