123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670 |
- "use strict";
- var __assign = (this && this.__assign) || function () {
- __assign = Object.assign || function(t) {
- for (var s, i = 1, n = arguments.length; i < n; i++) {
- s = arguments[i];
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
- t[p] = s[p];
- }
- return t;
- };
- return __assign.apply(this, arguments);
- };
- var __importDefault = (this && this.__importDefault) || function (mod) {
- return (mod && mod.__esModule) ? mod : { "default": mod };
- };
- Object.defineProperty(exports, "__esModule", { value: true });
- var lodash_1 = __importDefault(require("lodash"));
- var CloudDeviceController_1 = __importDefault(require("./CloudDeviceController"));
- var CloudSwitchController_1 = __importDefault(require("./CloudSwitchController"));
- var CloudTandHModificationController_1 = __importDefault(require("./CloudTandHModificationController"));
- var DiyDeviceController_1 = __importDefault(require("./DiyDeviceController"));
- var dataUtil_1 = require("../utils/dataUtil");
- var LanDeviceController_1 = __importDefault(require("./LanDeviceController"));
- var CloudRGBBulbController_1 = __importDefault(require("./CloudRGBBulbController"));
- var CloudPowerDetectionSwitchController_1 = __importDefault(require("./CloudPowerDetectionSwitchController"));
- var CloudMultiChannelSwitchController_1 = __importDefault(require("./CloudMultiChannelSwitchController"));
- var CloudRGBLightStripController_1 = __importDefault(require("./CloudRGBLightStripController"));
- var formatLanDevice_1 = __importDefault(require("../utils/formatLanDevice"));
- var LanSwitchController_1 = __importDefault(require("./LanSwitchController"));
- var LanMultiChannelSwitchController_1 = __importDefault(require("./LanMultiChannelSwitchController"));
- var uiid_1 = require("../config/uiid");
- var CloudDoubleColorBulbController_1 = __importDefault(require("./CloudDoubleColorBulbController"));
- var UnsupportDeviceController_1 = __importDefault(require("./UnsupportDeviceController"));
- var CloudDualR3Controller_1 = __importDefault(require("./CloudDualR3Controller"));
- var LanDualR3Controller_1 = __importDefault(require("./LanDualR3Controller"));
- var LanTandHModificationController_1 = __importDefault(require("./LanTandHModificationController"));
- var LanPowerDetectionSwitchController_1 = __importDefault(require("./LanPowerDetectionSwitchController"));
- var CloudDW2WiFiController_1 = __importDefault(require("./CloudDW2WiFiController"));
- var CloudUIID104Controller_1 = __importDefault(require("./CloudUIID104Controller"));
- var CloudZigbeeUIID1770Controller_1 = __importDefault(require("./CloudZigbeeUIID1770Controller"));
- var CloudZigbeeUIID2026Controller_1 = __importDefault(require("./CloudZigbeeUIID2026Controller"));
- var CloudZigbeeUIID3026Controller_1 = __importDefault(require("./CloudZigbeeUIID3026Controller"));
- var CloudZigbeeUIID4026Controller_1 = __importDefault(require("./CloudZigbeeUIID4026Controller"));
- var CloudZigbeeUIID1000Controller_1 = __importDefault(require("./CloudZigbeeUIID1000Controller"));
- var mergeDeviceParams_1 = __importDefault(require("../utils/mergeDeviceParams"));
- var CloudCoverController_1 = __importDefault(require("./CloudCoverController"));
- var CloudRFBridgeController_1 = __importDefault(require("./CloudRFBridgeController"));
- var LanRFBridgeController_1 = __importDefault(require("./LanRFBridgeController"));
- var CloudUIID44Controller_1 = __importDefault(require("./CloudUIID44Controller"));
- var CloudUIID34Controller_1 = __importDefault(require("./CloudUIID34Controller"));
- var LanUIID34Controller_1 = __importDefault(require("./LanUIID34Controller"));
- var ELanType_1 = __importDefault(require("../ts/enum/ELanType"));
- var CloudNSPanelController_1 = __importDefault(require("./CloudNSPanelController"));
- var logger_1 = require("../utils/logger");
- var CloudUIID181Controller_1 = __importDefault(require("./CloudUIID181Controller"));
- var CloudUIID190Controller_1 = __importDefault(require("./CloudUIID190Controller"));
- var CloudZigbeeMultiSwitchController_1 = __importDefault(require("./CloudZigbeeMultiSwitchController"));
- var CloudZigbeeDoubleColorBulbController_1 = __importDefault(require("./CloudZigbeeDoubleColorBulbController"));
- var CloudZigbeeFiveColorBulbController_1 = __importDefault(require("./CloudZigbeeFiveColorBulbController"));
- var CloudUIID137Controller_1 = __importDefault(require("./CloudUIID137Controller"));
- var CloudUIID173Controller_1 = __importDefault(require("./CloudUIID173Controller"));
- var CloudUIID130Controller_1 = __importDefault(require("./CloudUIID130Controller"));
- var CloudUIID182Controller_1 = __importDefault(require("./CloudUIID182Controller"));
- var Controller = (function () {
- function Controller() {
- }
- Controller.getDevice = function (id) {
- if (id) {
- var tmp = id.replace(/.*(?=\.)\./, '');
- return Controller.deviceMap.get(tmp);
- }
- return null;
- };
- Controller.getDeviceName = function (id) {
- var tmp = id.replace(/.*(?=\.)\./, '');
- return Controller.deviceMap.get(tmp).deviceName || '';
- };
- Controller.setDevice = function (params) {
- var id = params.id, type = params.type, data = params.data, lanType = params.lanType, index = params.index;
- var _index = index || this.count++;
- if (lodash_1.default.isEmpty(id)) {
- return null;
- }
- var disabled = (0, dataUtil_1.getDataSync)('disabled.json', [id]) || false;
- if (type === 1) {
- var tmp = data;
- if (!tmp.a) {
- return;
- }
- var diyDevice = new DiyDeviceController_1.default({
- ip: tmp.a,
- port: tmp.srv.port,
- deviceId: id,
- disabled: disabled,
- txt: tmp.txt,
- });
- Controller.deviceMap.set(id, diyDevice);
- return diyDevice;
- }
- if (type === 2) {
- var params_1 = (0, formatLanDevice_1.default)(data);
- if (!params_1 || (!params_1.ip && !params_1.target)) {
- logger_1.logger.info("This device is not LAN support, deviceId: ".concat(params_1 === null || params_1 === void 0 ? void 0 : params_1.deviceId));
- return;
- }
- var old = Controller.getDevice(id);
- if (old instanceof LanDeviceController_1.default) {
- if (params_1.iv && params_1.encryptedData) {
- old.iv = params_1 === null || params_1 === void 0 ? void 0 : params_1.iv;
- old.encryptedData = params_1 === null || params_1 === void 0 ? void 0 : params_1.encryptedData;
- }
- if (old.iv && old.devicekey && old.encryptedData) {
- var tmpParams = old.parseEncryptedData();
- tmpParams && (old.params = (0, mergeDeviceParams_1.default)(old.params, tmpParams));
- }
- return old;
- }
- var oldDeviceParams = {};
- if (old instanceof CloudDeviceController_1.default) {
- oldDeviceParams = {
- index: old.index,
- devicekey: old.devicekey,
- selfApikey: old.apikey,
- deviceName: old.deviceName,
- extra: old.extra,
- params: old.params,
- uiid: old.uiid,
- };
- if (uiid_1.unsupportedLanModeModelSet.has(old.extra.model)) {
- return old;
- }
- }
- if (old instanceof CloudMultiChannelSwitchController_1.default) {
- oldDeviceParams.maxChannel = old.maxChannel;
- }
- if (uiid_1.unsupportedLanModeUiidSet.has(oldDeviceParams.uiid)) {
- return null;
- }
- if (lanType === ELanType_1.default.Plug) {
- var lanDevice = new LanSwitchController_1.default(__assign(__assign(__assign({}, params_1), oldDeviceParams), { disabled: disabled }));
- Controller.deviceMap.set(id, lanDevice);
- return lanDevice;
- }
- else if (lanType === ELanType_1.default.Strip) {
- var lanDevice = new LanMultiChannelSwitchController_1.default(__assign(__assign(__assign({}, params_1), oldDeviceParams), { disabled: disabled }));
- Controller.deviceMap.set(id, lanDevice);
- return lanDevice;
- }
- else if (lanType === ELanType_1.default.MultifunSwitch) {
- var lanDevice = new LanDualR3Controller_1.default(__assign(__assign(__assign({}, params_1), oldDeviceParams), { disabled: disabled }));
- Controller.deviceMap.set(id, lanDevice);
- return lanDevice;
- }
- else if (lanType === ELanType_1.default.THPlug) {
- var lanDevice = new LanTandHModificationController_1.default(__assign(__assign(__assign({}, params_1), oldDeviceParams), { disabled: disabled }));
- Controller.deviceMap.set(id, lanDevice);
- return lanDevice;
- }
- else if (lanType === ELanType_1.default.EnhancedPlug) {
- var lanDevice = new LanPowerDetectionSwitchController_1.default(__assign(__assign(__assign({}, params_1), oldDeviceParams), { disabled: disabled }));
- Controller.deviceMap.set(id, lanDevice);
- return lanDevice;
- }
- else if (lanType === ELanType_1.default.RF) {
- var lanDevice = new LanRFBridgeController_1.default(__assign(__assign(__assign({}, params_1), oldDeviceParams), { disabled: disabled }));
- Controller.deviceMap.set(id, lanDevice);
- return lanDevice;
- }
- else if (lanType === ELanType_1.default.FanLight) {
- var lanDevice = new LanUIID34Controller_1.default(__assign(__assign(__assign({}, params_1), oldDeviceParams), { disabled: disabled }));
- Controller.deviceMap.set(id, lanDevice);
- return lanDevice;
- }
- }
- if (type >= 4) {
- if (uiid_1.switchUiidSet.has(data.extra.uiid)) {
- var tmp = data;
- var switchDevice = new CloudSwitchController_1.default({
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- online: tmp.online,
- devicekey: tmp.devicekey,
- disabled: disabled,
- index: _index,
- });
- Controller.deviceMap.set(id, switchDevice);
- return switchDevice;
- }
- if (uiid_1.multiChannelSwitchUiidSet.has(data.extra.uiid)) {
- var tmp = data;
- var device = new CloudMultiChannelSwitchController_1.default({
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- tags: tmp.tags,
- online: tmp.online,
- devicekey: tmp.devicekey,
- disabled: disabled,
- index: _index,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (uiid_1.zigbeeMultiSwitchSet.has(data.extra.uiid)) {
- var tmp = data;
- var device = new CloudZigbeeMultiSwitchController_1.default({
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- tags: tmp.tags,
- online: tmp.online,
- devicekey: tmp.devicekey,
- disabled: disabled,
- index: _index,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 11) {
- var tmp = data;
- var device = new CloudCoverController_1.default({
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- online: tmp.online,
- devicekey: tmp.devicekey,
- disabled: disabled,
- index: _index,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 15) {
- var tmp = data;
- var thmDevice = new CloudTandHModificationController_1.default({
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- online: tmp.online,
- devicekey: tmp.devicekey,
- disabled: disabled,
- index: _index,
- });
- Controller.deviceMap.set(id, thmDevice);
- return thmDevice;
- }
- if (data.extra.uiid === 22) {
- var tmp = data;
- var rgbLight = new CloudRGBBulbController_1.default({
- deviceId: tmp.deviceid,
- devicekey: tmp.devicekey,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- online: tmp.online,
- disabled: disabled,
- index: _index,
- });
- Controller.deviceMap.set(id, rgbLight);
- return rgbLight;
- }
- if (data.extra.uiid === 28) {
- var tmp = data;
- var rfBirdge = new CloudRFBridgeController_1.default({
- deviceId: tmp.deviceid,
- devicekey: tmp.devicekey,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- online: tmp.online,
- disabled: disabled,
- index: _index,
- tags: tmp.tags,
- });
- Controller.deviceMap.set(id, rfBirdge);
- return rfBirdge;
- }
- if (data.extra.uiid === 32 || data.extra.uiid === 5) {
- var tmp = data;
- var switchDevice = new CloudPowerDetectionSwitchController_1.default({
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- online: tmp.online,
- devicekey: tmp.devicekey,
- disabled: disabled,
- index: _index,
- });
- Controller.deviceMap.set(id, switchDevice);
- return switchDevice;
- }
- if (data.extra.uiid === 34) {
- var tmp = data;
- var fanLight = new CloudUIID34Controller_1.default({
- deviceId: tmp.deviceid,
- devicekey: tmp.devicekey,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- online: tmp.online,
- disabled: disabled,
- index: _index,
- });
- Controller.deviceMap.set(id, fanLight);
- return fanLight;
- }
- if (data.extra.uiid === 44) {
- var tmp = data;
- var dimming = new CloudUIID44Controller_1.default({
- deviceId: tmp.deviceid,
- devicekey: tmp.devicekey,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- online: tmp.online,
- disabled: disabled,
- index: _index,
- });
- Controller.deviceMap.set(id, dimming);
- return dimming;
- }
- if (data.extra.uiid === 59) {
- var tmp = data;
- var device = new CloudRGBLightStripController_1.default({
- deviceId: tmp.deviceid,
- devicekey: tmp.devicekey,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- online: tmp.online,
- disabled: disabled,
- index: _index,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 102) {
- var tmp = data;
- var device = new CloudDW2WiFiController_1.default({
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- devicekey: tmp.devicekey,
- disabled: disabled,
- online: tmp.online,
- index: _index,
- devConfig: tmp.devConfig,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 103) {
- var tmp = data;
- var device = new CloudDoubleColorBulbController_1.default({
- devicekey: tmp.devicekey,
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- params: tmp.params,
- online: tmp.online,
- apikey: tmp.apikey,
- extra: tmp.extra,
- index: _index,
- disabled: disabled,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 104) {
- var tmp = data;
- var device = new CloudUIID104Controller_1.default({
- devicekey: tmp.devicekey,
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- params: tmp.params,
- online: tmp.online,
- apikey: tmp.apikey,
- extra: tmp.extra,
- index: _index,
- disabled: disabled,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 126) {
- var tmp = data;
- var device = new CloudDualR3Controller_1.default({
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- devicekey: tmp.devicekey,
- disabled: disabled,
- online: tmp.online,
- index: _index,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 130) {
- var tmp = data;
- var device = new CloudUIID130Controller_1.default({
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- devicekey: tmp.devicekey,
- disabled: disabled,
- tags: tmp.tags,
- online: tmp.online,
- index: _index,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 137) {
- var tmp = data;
- var device = new CloudUIID137Controller_1.default({
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- devicekey: tmp.devicekey,
- disabled: disabled,
- online: tmp.online,
- index: _index,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 173) {
- var tmp = data;
- var device = new CloudUIID173Controller_1.default({
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- devicekey: tmp.devicekey,
- disabled: disabled,
- online: tmp.online,
- index: _index,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 182) {
- var tmp = data;
- var device = new CloudUIID182Controller_1.default({
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- extra: tmp.extra,
- params: tmp.params,
- devicekey: tmp.devicekey,
- disabled: disabled,
- tags: tmp.tags,
- online: tmp.online,
- index: _index,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 1000) {
- var tmp = data;
- var device = new CloudZigbeeUIID1000Controller_1.default({
- devicekey: tmp.devicekey,
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- params: tmp.params,
- online: tmp.online,
- extra: tmp.extra,
- index: _index,
- disabled: disabled,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 1770) {
- var tmp = data;
- var device = new CloudZigbeeUIID1770Controller_1.default({
- devicekey: tmp.devicekey,
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- params: tmp.params,
- online: tmp.online,
- extra: tmp.extra,
- index: _index,
- disabled: disabled,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 2026) {
- var tmp = data;
- var device = new CloudZigbeeUIID2026Controller_1.default({
- devicekey: tmp.devicekey,
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- apikey: tmp.apikey,
- params: tmp.params,
- online: tmp.online,
- extra: tmp.extra,
- index: _index,
- disabled: disabled,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 3026) {
- var tmp = data;
- var device = new CloudZigbeeUIID3026Controller_1.default({
- devicekey: tmp.devicekey,
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- params: tmp.params,
- apikey: tmp.apikey,
- online: tmp.online,
- extra: tmp.extra,
- index: _index,
- disabled: disabled,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 4026) {
- var tmp = data;
- var device = new CloudZigbeeUIID4026Controller_1.default({
- devicekey: tmp.devicekey,
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- params: tmp.params,
- apikey: tmp.apikey,
- online: tmp.online,
- extra: tmp.extra,
- index: _index,
- disabled: disabled,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 133) {
- var tmp = data;
- var device = new CloudNSPanelController_1.default({
- devicekey: tmp.devicekey,
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- params: tmp.params,
- apikey: tmp.apikey,
- online: tmp.online,
- extra: tmp.extra,
- index: _index,
- tags: tmp.tags,
- disabled: disabled
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 181) {
- var tmp = data;
- var device = new CloudUIID181Controller_1.default({
- devicekey: tmp.devicekey,
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- params: tmp.params,
- apikey: tmp.apikey,
- online: tmp.online,
- extra: tmp.extra,
- index: _index,
- tags: tmp.tags,
- disabled: disabled
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 190) {
- var tmp = data;
- var device = new CloudUIID190Controller_1.default({
- devicekey: tmp.devicekey,
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- params: tmp.params,
- apikey: tmp.apikey,
- online: tmp.online,
- extra: tmp.extra,
- index: _index,
- tags: tmp.tags,
- disabled: disabled
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 1258) {
- var tmp = data;
- var device = new CloudZigbeeDoubleColorBulbController_1.default({
- devicekey: tmp.devicekey,
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- params: tmp.params,
- apikey: tmp.apikey,
- online: tmp.online,
- extra: tmp.extra,
- index: _index,
- disabled: disabled,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (data.extra.uiid === 3258) {
- var tmp = data;
- var device = new CloudZigbeeFiveColorBulbController_1.default({
- devicekey: tmp.devicekey,
- deviceId: tmp.deviceid,
- deviceName: tmp.name,
- params: tmp.params,
- apikey: tmp.apikey,
- online: tmp.online,
- extra: tmp.extra,
- index: _index,
- disabled: disabled,
- });
- Controller.deviceMap.set(id, device);
- return device;
- }
- if (!Controller.deviceMap.has(id)) {
- var unsupportDevice = new UnsupportDeviceController_1.default({
- deviceId: data.deviceid,
- deviceName: data.name,
- apikey: data.apikey,
- extra: data.extra,
- params: data.params,
- online: data.online,
- devicekey: data.devicekey,
- disabled: disabled,
- index: -_index,
- });
- Controller.unsupportDeviceMap.set(id, unsupportDevice);
- }
- }
- };
- Controller.deviceMap = new Map();
- Controller.unsupportDeviceMap = new Map();
- Controller.count = 999;
- return Controller;
- }());
- exports.default = Controller;
|