diff --git a/admin/jsonConfig.json b/admin/jsonConfig.json index c66d13f..bab1388 100644 --- a/admin/jsonConfig.json +++ b/admin/jsonConfig.json @@ -13,6 +13,8 @@ "sm": 12, "md": 6, "lg": 6, + "xs": 12, + "xl": 6, "label": "Solix Username", "help": "Please use a Family-Acoount how can only watch, dont use your main account." }, @@ -23,6 +25,8 @@ "sm": 12, "md": 6, "lg": 6, + "xs": 12, + "xl": 6, "label": "Solix Password" }, "COUNTRY": { @@ -49,6 +53,8 @@ "sm": 12, "md": 4, "lg": 4, + "xs": 12, + "xl": 6, "newLine": true }, "POLL_INTERVAL": { @@ -57,6 +63,8 @@ "sm": 12, "md": 4, "lg": 4, + "xs": 12, + "xl": 6, "min": 10, "max": 3600, "label": "Polltime in secounds", diff --git a/io-package.json b/io-package.json index 8f4660a..31047ec 100644 --- a/io-package.json +++ b/io-package.json @@ -1,171 +1,123 @@ { - "common": { - "name": "ankersolix2", - "version": "1.0.2", - "news": { - "1.0.2": { - "en": "bugfix", - "de": "fehlerbehebung", - "ru": "исправления", - "pt": "correção de erros", - "nl": "bugfix", - "fr": "correction du bug", - "it": "bugfix", - "es": "bugfix", - "pl": "bugfix", - "uk": "панчохи", - "zh-cn": "错误修正" - }, - "1.0.1": { - "en": "ESLint 9.x", - "de": "ESLint 9.x", - "ru": "ESLint 9.x", - "pt": "ESLint 9.x", - "nl": "ESLint 9.x", - "fr": "ESLint 9.x", - "it": "ESLint 9.x", - "es": "ESLint 9.x", - "pl": "ESLint 9.x", - "uk": "ESLint 9.х", - "zh-cn": "ESLint 9.x (英语)" - }, - "1.0.0": { - "en": "stable release\nfixed backup_info object", - "de": "stabiler release\nfixed backup_info object", - "ru": "стабильный выпуск\nфиксированная резервная копия_info", - "pt": "liberação estável\nobjeto corrigido backup_info", - "nl": "stabiele afgifte\nvast backup_info-object", - "fr": "libération stable\nobjet_info de sauvegarde fixe", - "it": "rilascio stabile\noggetto backup_info fisso", - "es": "liberación estable\nbackup_info objeto", - "pl": "stabilne uwalnianie\nustawiony obiekt backup _ info", - "uk": "стабільний реліз\nвиправлено резервне копіювання_info об'єкт", - "zh-cn": "稳定释放\n固定备份_ info 对象" - }, - "0.1.0-beta.0": { - "en": "beta release", - "de": "beta release", - "ru": "beta release", - "pt": "versão beta", - "nl": "beta release", - "fr": "libération bêta", - "it": "beta release", - "es": "beta release", - "pl": "uwalnianie beta", - "uk": "бета реліз", - "zh-cn": "β释放" - }, - "0.0.3-alpha.0": { - "en": "fix session.data\nnpm release", - "de": "die sitzung zu reparieren. daten\nnpm release", - "ru": "починить сеанс. данные\nnpm релиз", - "pt": "corrigir sessão. dados\nliberação npm", - "nl": "maak een sessie. gegevens\nnpm release", - "fr": "la séance de réparation. données\nnpm libération", - "it": "sessione di correzione. dati\nnpm rilascio", - "es": "fijar sesión. datos\nnpm de liberación", - "pl": "napraw sesję. dane\nuwolnienie npm", - "uk": "фіксація сеансу. дані\nnpm реліз", - "zh-cn": "固定会话。 数据\nnpm 发布" - }, - "0.0.2-alpha.0": { - "en": "initial release", - "de": "erstausstrahlung", - "ru": "первоначальный выпуск", - "pt": "lançamento inicial", - "nl": "eerste release", - "fr": "libération initiale", - "it": "rilascio iniziale", - "es": "liberación inicial", - "pl": "początkowe zwolnienie", - "uk": "початковий реліз", - "zh-cn": "初步释放" - }, - "0.0.1": { - "en": "initial release", - "de": "Erstveröffentlichung", - "ru": "Начальная версия", - "pt": "lançamento inicial", - "nl": "Eerste uitgave", - "fr": "Première version", - "it": "Versione iniziale", - "es": "Versión inicial", - "pl": "Pierwsze wydanie", - "uk": "Початкова версія", - "zh-cn": "首次出版" - } + "common": { + "name": "ankersolix2", + "version": "1.0.2", + "news": { + "1.0.2": { + "en": "bugfix", + "de": "fehlerbehebung", + "ru": "исправления", + "pt": "correção de erros", + "nl": "bugfix", + "fr": "correction du bug", + "it": "bugfix", + "es": "bugfix", + "pl": "bugfix", + "uk": "панчохи", + "zh-cn": "错误修正" + }, + "1.0.1": { + "en": "ESLint 9.x", + "de": "ESLint 9.x", + "ru": "ESLint 9.x", + "pt": "ESLint 9.x", + "nl": "ESLint 9.x", + "fr": "ESLint 9.x", + "it": "ESLint 9.x", + "es": "ESLint 9.x", + "pl": "ESLint 9.x", + "uk": "ESLint 9.х", + "zh-cn": "ESLint 9.x (英语)" + }, + "0.1.0-beta.0": { + "en": "beta release", + "de": "beta release", + "ru": "beta release", + "pt": "versão beta", + "nl": "beta release", + "fr": "libération bêta", + "it": "beta release", + "es": "beta release", + "pl": "uwalnianie beta", + "uk": "бета реліз", + "zh-cn": "β释放" + }, + "0.0.3-alpha.0": { + "en": "fix session.data\nnpm release", + "de": "die sitzung zu reparieren. daten\nnpm release", + "ru": "починить сеанс. данные\nnpm релиз", + "pt": "corrigir sessão. dados\nliberação npm", + "nl": "maak een sessie. gegevens\nnpm release", + "fr": "la séance de réparation. données\nnpm libération", + "it": "sessione di correzione. dati\nnpm rilascio", + "es": "fijar sesión. datos\nnpm de liberación", + "pl": "napraw sesję. dane\nuwolnienie npm", + "uk": "фіксація сеансу. дані\nnpm реліз", + "zh-cn": "固定会话。 数据\nnpm 发布" + } + }, + "titleLang": { + "en": "Anker Solix 2", + "de": "Anker Solix 2", + "ru": "Анкер Соликс 2", + "pt": "Anker Solix 2", + "nl": "Anker Solix 2", + "fr": "Anker Solix 2", + "it": "Anker Solix 2", + "es": "Anker Solix 2", + "pl": "Anker Solix 2", + "uk": "Анкер Солікс 2", + "zh-cn": "安克索利克斯 2" + }, + "desc": { + "en": "Integrade Anker Solix 2", + "de": "Integrieren Sie Anker Solix 2", + "ru": "Интеграция Анкер Соликс 2", + "pt": "Integração Anker Solix 2", + "nl": "Integreer Anker Solix 2", + "fr": "Intégrer Anker Solix 2", + "it": "Integrato Anker Solix 2", + "es": "Integrar Anker Solix 2", + "pl": "Zintegruj Anker Solix 2", + "uk": "Інтеграція Anker Solix 2", + "zh-cn": "集成 Anker Solix 2" + }, + "authors": ["ronny130286 "], + "keywords": ["Anker", "Solix", "Solarbank", "Solarbank 2", "IoT"], + "licenseInformation": { + "type": "free", + "license": "MIT" + }, + "platform": "Javascript/Node.js", + "icon": "ankersolix2.png", + "enabled": true, + "extIcon": "https://raw.githubusercontent.com/ronny130286/ioBroker.ankersolix2/main/admin/ankersolix2.png", + "readme": "https://github.com/ronny130286/ioBroker.ankersolix2/blob/main/README.md", + "loglevel": "info", + "tier": 3, + "mode": "daemon", + "type": "iot-systems", + "compact": true, + "connectionType": "cloud", + "dataSource": "poll", + "adminUI": { + "config": "json" + }, + "dependencies": [ + { + "js-controller": ">=5.1.13" + } + ], + "globalDependencies": [ + { + "admin": ">=5.1.13" + } + ] }, - "titleLang": { - "en": "Anker Solix 2", - "de": "Anker Solix 2", - "ru": "Анкер Соликс 2", - "pt": "Anker Solix 2", - "nl": "Anker Solix 2", - "fr": "Anker Solix 2", - "it": "Anker Solix 2", - "es": "Anker Solix 2", - "pl": "Anker Solix 2", - "uk": "Анкер Солікс 2", - "zh-cn": "安克索利克斯 2" + "native": { + "option1": true, + "option2": "42" }, - "desc": { - "en": "Integrade Anker Solix 2", - "de": "Integrieren Sie Anker Solix 2", - "ru": "Интеграция Анкер Соликс 2", - "pt": "Integração Anker Solix 2", - "nl": "Integreer Anker Solix 2", - "fr": "Intégrer Anker Solix 2", - "it": "Integrato Anker Solix 2", - "es": "Integrar Anker Solix 2", - "pl": "Zintegruj Anker Solix 2", - "uk": "Інтеграція Anker Solix 2", - "zh-cn": "集成 Anker Solix 2" - }, - "authors": [ - "ronny130286 " - ], - "keywords": [ - "Anker", - "Solix", - "Solarbank", - "Solarbank 2", - "IoT" - ], - "licenseInformation": { - "type": "free", - "license": "MIT" - }, - "platform": "Javascript/Node.js", - "main": "build/main.js", - "icon": "ankersolix2.png", - "enabled": true, - "extIcon": "https://raw.githubusercontent.com/ronny130286/ioBroker.ankersolix2/main/admin/ankersolix2.png", - "readme": "https://github.com/ronny130286/ioBroker.ankersolix2/blob/main/README.md", - "loglevel": "info", - "tier": 3, - "mode": "daemon", - "type": "iot-systems", - "compact": true, - "connectionType": "cloud", - "dataSource": "poll", - "adminUI": { - "config": "json" - }, - "dependencies": [ - { - "js-controller": ">=3.3.22" - } - ], - "globalDependencies": [ - { - "admin": ">=5.1.13" - } - ] - }, - "native": { - "option1": true, - "option2": "42" - }, - "objects": [], - "instanceObjects": [] + "objects": [], + "instanceObjects": [] } diff --git a/package.json b/package.json index 46b2a82..8012fd1 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "Solix", "Solarbank", "Solarbank 2", - "IoT" + "IoT", + "ioBroker" ], "repository": { "type": "git", @@ -33,9 +34,9 @@ "@alcalzone/release-script-plugin-iobroker": "^3.7.2", "@alcalzone/release-script-plugin-license": "^3.7.0", "@alcalzone/release-script-plugin-manual-review": "^3.7.0", - "@eslint/js": "9.16.0", + "@eslint/js": "^9.16.0", "@iobroker/adapter-dev": "^1.3.0", - "@iobroker/eslint-config": "1.0.0", + "@iobroker/eslint-config": "^1.0.0", "@iobroker/testing": "^5.0.0", "@tsconfig/node20": "^20.1.4", "@types/chai": "^4.3.19", @@ -61,7 +62,7 @@ "sinon-chai": "^4.0.0", "source-map-support": "^0.5.21", "ts-node": "^10.9.2", - "typescript": "5.7.2" + "typescript": "^5.7.2" }, "main": "build/main.js", "files": [ diff --git a/src/main.ts b/src/main.ts index c8d9839..ec02127 100644 --- a/src/main.ts +++ b/src/main.ts @@ -143,8 +143,6 @@ class Ankersolix2 extends utils.Adapter { async refreshDate(): Promise { this.loginData = await this.loginAPI(); - //this.log.debug('loginData: ' + JSON.stringify(this.loginData)); - if (this.loginData) { await this.fetchAndPublish(); @@ -156,7 +154,7 @@ class Ankersolix2 extends utils.Adapter { } } - async fetchAndPublish(): Promise { + async fetchAndPublish(): Promise { this.log.debug('fetchAndPublish()'); try { @@ -178,8 +176,6 @@ class Ankersolix2 extends utils.Adapter { const message = JSON.stringify(scenInfo.data); const jsonparse = JSON.parse(message); - //this.log.debug('JSON: ' + message); - this.CreateOrUpdate(site.site_id, jsonparse.home_info.home_name, 'device'); this.CreateOrUpdate( site.site_id + '.EXTRA.RAW_JSON', @@ -192,21 +188,7 @@ class Ankersolix2 extends utils.Adapter { ); await this.setState(site.site_id + '.EXTRA.RAW_JSON', { val: message, ack: true }); - /* - this.log.warn('SITE_ID: ' + site.site_id); - const schedule = await loggedInApi.getSiteDeviceParam(ParamType.LoadConfiguration, site.site_id); - const m_schedule = JSON.stringify(schedule); - this.CreateOrUpdate( - site.site_id + '.EXTRA.Schedule_JSON', - 'Schedule_JSON', - 'state', - 'string', - 'value', - false, - 'undefined', - ); - await this.setState(site.site_id + '.EXTRA.Schedule_JSON', { val: m_schedule, ack: true }); - */ + Object.entries(jsonparse).forEach((entries) => { const [id, value] = entries; @@ -231,14 +213,10 @@ class Ankersolix2 extends utils.Adapter { this.isString(key, value); } }); - - //fs.writeFileSync(utils.getAbsoluteInstanceDataDir(this) + '/scenInfo.json', message, 'utf8'); } this.log.debug('Published.'); - return true; } else { this.log.error('loggedInApi Errorcode: ' + siteHomepage.code); - return false; } } catch (error) { const status = (error as any).code; @@ -263,8 +241,6 @@ class Ankersolix2 extends utils.Adapter { await sleep(this.sleepInterval); } */ - return false; - //this.log.error('Clear session.data, please wait'); } }