Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d39cc9d1d | ||
|
|
c0defc48a5 | ||
|
|
d525d5b26b | ||
|
|
a64ef243f0 | ||
|
|
9a24c2be91 | ||
|
|
d541114da1 | ||
|
|
eb7b8b0e68 | ||
|
|
e139c9bc27 | ||
|
|
40550a747b | ||
|
|
9a886b1155 | ||
|
|
039e856f7a | ||
|
|
06cdfbd9e4 | ||
|
|
e92d488529 | ||
|
|
d5f874cf84 | ||
|
|
952680454b | ||
|
|
c4fb2d37aa | ||
|
|
1f06d5afac | ||
|
|
a64edae70c | ||
|
|
477e910371 | ||
|
|
959a5f7a3f | ||
|
|
90f53d8ce8 | ||
|
|
360baf112e | ||
|
|
164a8c6bee | ||
|
|
89a588b73d | ||
|
|
36f296ee8f | ||
|
|
b9e92864a0 | ||
|
|
1ed00c8778 | ||
|
|
d1442504e8 | ||
|
|
2ca9828262 | ||
|
|
2e78c1f42b | ||
|
|
8dbde9bbcb | ||
|
|
1b6d9bbeea |
+14
-10
@@ -1,16 +1,20 @@
|
|||||||
|
# Dependabot will run on day 17 of each month at 02:15 (Europe/Berlin timezone)
|
||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
- package-ecosystem: github-actions
|
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: monthly
|
interval: "cron"
|
||||||
time: "04:00"
|
timezone: "Europe/Berlin"
|
||||||
timezone: Europe/Berlin
|
cronjob: "15 2 17 * *"
|
||||||
- package-ecosystem: npm
|
open-pull-requests-limit: 15
|
||||||
|
|
||||||
|
- package-ecosystem: "npm"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: monthly
|
interval: "cron"
|
||||||
time: "04:00"
|
timezone: "Europe/Berlin"
|
||||||
timezone: Europe/Berlin
|
cronjob: "15 2 17 * *"
|
||||||
open-pull-requests-limit: 5
|
open-pull-requests-limit: 15
|
||||||
versioning-strategy: increase
|
versioning-strategy: "increase"
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
# Workflow for auto-merging Dependabot PRs
|
||||||
|
# This workflow uses the action-automerge-dependabot action to automatically merge
|
||||||
|
# Dependabot PRs based on the rules defined in .github/auto-merge.yml
|
||||||
|
|
||||||
|
name: Auto-Merge Dependabot PRs
|
||||||
|
|
||||||
|
on:
|
||||||
|
# Trigger when a PR is opened or updated
|
||||||
|
# WARNING: This needs to be run in the PR base, DO NOT build untrusted code in this action
|
||||||
|
pull_request_target:
|
||||||
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
auto-merge:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
# Only run if actor is dependabot
|
||||||
|
if: github.actor == 'dependabot[bot]'
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
pull-requests: write
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Auto-merge Dependabot PRs
|
||||||
|
uses: iobroker-bot-orga/action-automerge-dependabot@v1
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
# Optional: Path to your auto-merge configuration file
|
||||||
|
# config-file-path: '.github/auto-merge.yml'
|
||||||
|
# Optional: Merge method (merge, squash, or rebase)
|
||||||
|
# merge-method: 'squash'
|
||||||
|
# Optional: Wait for other checks to complete
|
||||||
|
# wait-for-checks: 'true'
|
||||||
|
# Optional: Maximum time to wait for checks in seconds (default: 3600)
|
||||||
|
# max-wait-time: '3600'
|
||||||
@@ -24,18 +24,18 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v4
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
queries: +security-and-quality
|
queries: +security-and-quality
|
||||||
|
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@v2
|
uses: github/codeql-action/autobuild@v4
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v2
|
uses: github/codeql-action/analyze@v4
|
||||||
with:
|
with:
|
||||||
category: "/language:${{ matrix.language }}"
|
category: "/language:${{ matrix.language }}"
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: ioBroker/testing-action-check@v1
|
- uses: ioBroker/testing-action-check@v1
|
||||||
with:
|
with:
|
||||||
node-version: '22.x'
|
node-version: '24.x'
|
||||||
lint: true
|
lint: true
|
||||||
|
|
||||||
adapter-tests:
|
adapter-tests:
|
||||||
@@ -47,6 +47,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
|
build: true
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
needs: [check-and-lint, adapter-tests]
|
needs: [check-and-lint, adapter-tests]
|
||||||
@@ -66,5 +67,6 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: ioBroker/testing-action-deploy@v1
|
- uses: ioBroker/testing-action-deploy@v1
|
||||||
with:
|
with:
|
||||||
node-version: '22.x'
|
node-version: '24.x'
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
build: true
|
||||||
|
|||||||
@@ -6,4 +6,7 @@ admin/i18n/flat.txt
|
|||||||
admin/i18n/*/flat.txt
|
admin/i18n/*/flat.txt
|
||||||
iob_npm.done
|
iob_npm.done
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
#ignore .commitinfo created by ioBroker release script
|
||||||
|
.commitinfo
|
||||||
.claude/settings.local.json
|
.claude/settings.local.json
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,10 @@ Please check it https://www.smarthomejetzt.de/mit-iobroker-auf-eine-home-assista
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
### 2.0.2 (2026-03-31)
|
### 2.0.4 (2026-05-05)
|
||||||
|
* (@GermanBluefox) Tried to keep the custom settings of the objects when updating them with new data from HASS
|
||||||
|
|
||||||
|
### 2.0.3 (2026-04-02)
|
||||||
* (@GermanBluefox) Adapter was updated and migrated to TypeScript
|
* (@GermanBluefox) Adapter was updated and migrated to TypeScript
|
||||||
* (@Titanium177) Added roles for states and added debouncing for reading states from hass
|
* (@Titanium177) Added roles for states and added debouncing for reading states from hass
|
||||||
|
|
||||||
|
|||||||
+19
-16
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"common": {
|
"common": {
|
||||||
"name": "hass",
|
"name": "hass",
|
||||||
"version": "2.0.2",
|
"version": "2.0.4",
|
||||||
"title": "Home Assistant",
|
"title": "Home Assistant",
|
||||||
"titleLang": {
|
"titleLang": {
|
||||||
"en": "Home Assistant",
|
"en": "Home Assistant",
|
||||||
@@ -30,7 +30,20 @@
|
|||||||
"uk": "Підключення Home Assistant для ioBroker"
|
"uk": "Підключення Home Assistant для ioBroker"
|
||||||
},
|
},
|
||||||
"news": {
|
"news": {
|
||||||
"2.0.2": {
|
"2.0.4": {
|
||||||
|
"en": "Tried to keep the custom settings of the objects when updating them with new data from HASS",
|
||||||
|
"de": "Versuche, die benutzerdefinierten Einstellungen der Objekte bei der Aktualisierung mit neuen Daten von HASS zu halten",
|
||||||
|
"ru": "Пытался сохранить пользовательские настройки объектов при обновлении их новыми данными из HASS",
|
||||||
|
"pt": "Tentou manter as configurações personalizadas dos objetos ao atualizá-los com novos dados do HASS",
|
||||||
|
"nl": "Geprobeerd om de aangepaste instellingen van de objecten te behouden bij het bijwerken ervan met nieuwe gegevens van HASS",
|
||||||
|
"fr": "Essai de conserver les paramètres personnalisés des objets lors de leur mise à jour avec de nouvelles données de HASS",
|
||||||
|
"it": "Ho cercato di mantenere le impostazioni personalizzate degli oggetti durante l'aggiornamento con nuovi dati da HASS",
|
||||||
|
"es": "Trató de mantener la configuración personalizada de los objetos al actualizarlos con nuevos datos de HASS",
|
||||||
|
"pl": "Próbował zachować niestandardowe ustawienia obiektów podczas ich aktualizacji nowymi danymi z HASS",
|
||||||
|
"uk": "При оновленні нових даних від HASS",
|
||||||
|
"zh-cn": "在用 HASS 的新数据更新对象时尝试保留对象的自定义设置"
|
||||||
|
},
|
||||||
|
"2.0.3": {
|
||||||
"en": "Adapter was updated and migrated to TypeScript\nAdded roles for states and added debouncing for reading states from hass",
|
"en": "Adapter was updated and migrated to TypeScript\nAdded roles for states and added debouncing for reading states from hass",
|
||||||
"de": "Adapter wurde aktualisiert und auf TypeScript migriert\nHinzugefügt Rollen für Staaten und hinzugefügt Debouncing für Lesezustände aus hass",
|
"de": "Adapter wurde aktualisiert und auf TypeScript migriert\nHinzugefügt Rollen für Staaten und hinzugefügt Debouncing für Lesezustände aus hass",
|
||||||
"ru": "Адаптер был обновлен и перенесен на TypeScript\nДобавлены роли для штатов и добавлены отговорки для чтения штатов из хэша",
|
"ru": "Адаптер был обновлен и перенесен на TypeScript\nДобавлены роли для штатов и добавлены отговорки для чтения штатов из хэша",
|
||||||
@@ -107,19 +120,6 @@
|
|||||||
"pl": "Pokaż ponownie zamaskowane pola haseł w konfiguracji",
|
"pl": "Pokaż ponownie zamaskowane pola haseł w konfiguracji",
|
||||||
"zh-cn": "在配置中再次显示被屏蔽的密码字段",
|
"zh-cn": "在配置中再次显示被屏蔽的密码字段",
|
||||||
"uk": "Знову показати замасковані поля пароля в конфігурації"
|
"uk": "Знову показати замасковані поля пароля в конфігурації"
|
||||||
},
|
|
||||||
"1.1.0": {
|
|
||||||
"en": "IMPORTANT: You need to re-enter the password once after installing this version!\nImplement Service triggers to use any value to trigger or stringified JSON to call with fields\nOptimize unload handling\nAdd Sentry for crash reporting",
|
|
||||||
"de": "WICHTIG: Nach der Installation dieser Version müssen Sie das Passwort einmalig neu eingeben!\nImplementieren Sie Dienstauslöser, um einen beliebigen Wert zum Auslösen oder stringifiziertes JSON zum Aufrufen mit Feldern zu verwenden\nEntladehandling optimieren\nFügen Sie Sentry für Absturzberichte hinzu",
|
|
||||||
"ru": "ВАЖНО: Вам необходимо повторно ввести пароль один раз после установки этой версии!\nРеализовать триггеры службы, чтобы использовать любое значение для запуска или строкового JSON для вызова с полями.\nОптимизация обработки разгрузки\nДобавьте Sentry для отчетов о сбоях",
|
|
||||||
"pt": "IMPORTANTE: Você precisa redigitar a senha uma vez depois de instalar esta versão!\nImplemente gatilhos de serviço para usar qualquer valor para acionar ou JSON stringified para chamar com campos\nOtimize o manuseio de descarga\nAdicionar Sentinela para relatórios de falhas",
|
|
||||||
"nl": "BELANGRIJK: u moet het wachtwoord één keer opnieuw invoeren na het installeren van deze versie!\nImplementeer servicetriggers om elke waarde te gebruiken om te activeren of stringified JSON om met velden aan te roepen\nOptimaliseer de losverwerking\nSentry toevoegen voor crashrapportage",
|
|
||||||
"fr": "IMPORTANT : Vous devez ressaisir le mot de passe une fois après l'installation de cette version !\nImplémentez des déclencheurs de service pour utiliser n'importe quelle valeur pour déclencher ou JSON stringifié pour appeler avec des champs\nOptimiser la gestion des déchargements\nAjouter Sentry pour les rapports de plantage",
|
|
||||||
"it": "IMPORTANTE: è necessario reinserire la password una volta dopo aver installato questa versione!\nImplementa i trigger del servizio per utilizzare qualsiasi valore per attivare o JSON in formato stringa per chiamare con i campi\nOttimizza la gestione dello scarico\nAggiungi Sentinella per la segnalazione degli arresti anomali",
|
|
||||||
"es": "IMPORTANTE: ¡Debe volver a ingresar la contraseña una vez después de instalar esta versión!\nImplementar disparadores de servicio para usar cualquier valor para disparar o JSON en cadena para llamar con campos\nOptimizar el manejo de descarga\nAgregar Sentry para informes de fallas",
|
|
||||||
"pl": "WAŻNE: Po zainstalowaniu tej wersji należy raz ponownie wprowadzić hasło!\nZaimplementuj wyzwalacze usługi, aby używać dowolnej wartości do wyzwalania lub skróconego JSON do wywołania z polami\nZoptymalizuj obsługę rozładunku\nDodaj Sentry do zgłaszania awarii",
|
|
||||||
"zh-cn": "重要提示:安装此版本后需要重新输入一次密码!\n实现服务触发器以使用任何值触发或字符串化 JSON 以使用字段调用\n优化卸载处理\n添加 Sentry 以进行崩溃报告",
|
|
||||||
"uk": "ВАЖЛИВО: після встановлення цієї версії потрібно повторно ввести пароль!\nРеалізуйте тригери служби, щоб використовувати будь-яке значення для запуску або рядковий JSON для виклику з полями\nОптимізуйте роботу з розвантаженням\nДодайте Sentry для звітування про збої"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"localLink": "http://%host%:8123",
|
"localLink": "http://%host%:8123",
|
||||||
@@ -131,7 +131,10 @@
|
|||||||
"adminUI": {
|
"adminUI": {
|
||||||
"config": "json"
|
"config": "json"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"licenseInformation": {
|
||||||
|
"type": "free",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"extIcon": "https://raw.githubusercontent.com/ioBroker/ioBroker.hass/master/admin/hass.png",
|
"extIcon": "https://raw.githubusercontent.com/ioBroker/ioBroker.hass/master/admin/hass.png",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"HASS",
|
"HASS",
|
||||||
|
|||||||
Generated
+23
-27
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "iobroker.hass",
|
"name": "iobroker.hass",
|
||||||
"version": "2.0.2",
|
"version": "2.0.4",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "iobroker.hass",
|
"name": "iobroker.hass",
|
||||||
"version": "2.0.2",
|
"version": "2.0.4",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@iobroker/adapter-core": "^3.3.2",
|
"@iobroker/adapter-core": "^3.3.2",
|
||||||
@@ -21,8 +21,7 @@
|
|||||||
"@iobroker/eslint-config": "^2.2.0",
|
"@iobroker/eslint-config": "^2.2.0",
|
||||||
"@iobroker/legacy-testing": "^2.0.2",
|
"@iobroker/legacy-testing": "^2.0.2",
|
||||||
"@iobroker/testing": "^5.2.2",
|
"@iobroker/testing": "^5.2.2",
|
||||||
"@types/ws": "^8.18.1",
|
"@types/ws": "^8.18.1"
|
||||||
"mocha": "^11.7.5"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@alcalzone/esbuild-register": {
|
"node_modules/@alcalzone/esbuild-register": {
|
||||||
@@ -2578,13 +2577,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/axios": {
|
"node_modules/axios": {
|
||||||
"version": "1.14.0",
|
"version": "1.16.0",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.16.0.tgz",
|
||||||
"integrity": "sha512-3Y8yrqLSwjuzpXuZ0oIYZ/XGgLwUIBU3uLvbcpb0pidD9ctpShJd43KSlEEkVQg6DS0G9NKyzOvBfUtDKEyHvQ==",
|
"integrity": "sha512-6hp5CwvTPlN2A31g5dxnwAX0orzM7pmCRDLnZSX772mv8WDqICwFjowHuPs04Mc8deIld1+ejhtaMn5vp6b+1w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"follow-redirects": "^1.15.11",
|
"follow-redirects": "^1.16.0",
|
||||||
"form-data": "^4.0.5",
|
"form-data": "^4.0.5",
|
||||||
"proxy-from-env": "^2.1.0"
|
"proxy-from-env": "^2.1.0"
|
||||||
}
|
}
|
||||||
@@ -4442,9 +4440,9 @@
|
|||||||
"license": "ISC"
|
"license": "ISC"
|
||||||
},
|
},
|
||||||
"node_modules/follow-redirects": {
|
"node_modules/follow-redirects": {
|
||||||
"version": "1.15.11",
|
"version": "1.16.0",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
|
||||||
"integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
|
"integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -4452,7 +4450,6 @@
|
|||||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4.0"
|
"node": ">=4.0"
|
||||||
},
|
},
|
||||||
@@ -6649,12 +6646,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/protobufjs": {
|
"node_modules/protobufjs": {
|
||||||
"version": "7.5.4",
|
"version": "7.5.5",
|
||||||
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz",
|
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.5.tgz",
|
||||||
"integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==",
|
"integrity": "sha512-3wY1AxV+VBNW8Yypfd1yQY9pXnqTAN+KwQxL8iYm3/BjKYMNg4i0owhEe26PWDOMaIrzeeF98Lqd5NGz4omiIg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "BSD-3-Clause",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@protobufjs/aspromise": "^1.1.2",
|
"@protobufjs/aspromise": "^1.1.2",
|
||||||
"@protobufjs/base64": "^1.1.2",
|
"@protobufjs/base64": "^1.1.2",
|
||||||
@@ -9723,12 +9719,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"axios": {
|
"axios": {
|
||||||
"version": "1.14.0",
|
"version": "1.16.0",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.16.0.tgz",
|
||||||
"integrity": "sha512-3Y8yrqLSwjuzpXuZ0oIYZ/XGgLwUIBU3uLvbcpb0pidD9ctpShJd43KSlEEkVQg6DS0G9NKyzOvBfUtDKEyHvQ==",
|
"integrity": "sha512-6hp5CwvTPlN2A31g5dxnwAX0orzM7pmCRDLnZSX772mv8WDqICwFjowHuPs04Mc8deIld1+ejhtaMn5vp6b+1w==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"follow-redirects": "^1.15.11",
|
"follow-redirects": "^1.16.0",
|
||||||
"form-data": "^4.0.5",
|
"form-data": "^4.0.5",
|
||||||
"proxy-from-env": "^2.1.0"
|
"proxy-from-env": "^2.1.0"
|
||||||
}
|
}
|
||||||
@@ -11000,9 +10996,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"follow-redirects": {
|
"follow-redirects": {
|
||||||
"version": "1.15.11",
|
"version": "1.16.0",
|
||||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
|
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
|
||||||
"integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
|
"integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"for-each": {
|
"for-each": {
|
||||||
@@ -12418,9 +12414,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"protobufjs": {
|
"protobufjs": {
|
||||||
"version": "7.5.4",
|
"version": "7.5.5",
|
||||||
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz",
|
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.5.tgz",
|
||||||
"integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==",
|
"integrity": "sha512-3wY1AxV+VBNW8Yypfd1yQY9pXnqTAN+KwQxL8iYm3/BjKYMNg4i0owhEe26PWDOMaIrzeeF98Lqd5NGz4omiIg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"@protobufjs/aspromise": "^1.1.2",
|
"@protobufjs/aspromise": "^1.1.2",
|
||||||
|
|||||||
+2
-3
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "iobroker.hass",
|
"name": "iobroker.hass",
|
||||||
"version": "2.0.2",
|
"version": "2.0.4",
|
||||||
"description": "Home Assistant",
|
"description": "Home Assistant",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "bluefox",
|
"name": "bluefox",
|
||||||
@@ -37,8 +37,7 @@
|
|||||||
"@iobroker/eslint-config": "^2.2.0",
|
"@iobroker/eslint-config": "^2.2.0",
|
||||||
"@iobroker/legacy-testing": "^2.0.2",
|
"@iobroker/legacy-testing": "^2.0.2",
|
||||||
"@iobroker/testing": "^5.2.2",
|
"@iobroker/testing": "^5.2.2",
|
||||||
"@types/ws": "^8.18.1",
|
"@types/ws": "^8.18.1"
|
||||||
"mocha": "^11.7.5"
|
|
||||||
},
|
},
|
||||||
"main": "build/main.js",
|
"main": "build/main.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
|||||||
+28
-3
@@ -403,26 +403,51 @@ class HassAdapter extends Adapter {
|
|||||||
|
|
||||||
private async deleteStaleObjects(expectedObjects: Set<string>): Promise<number> {
|
private async deleteStaleObjects(expectedObjects: Set<string>): Promise<number> {
|
||||||
const objectsToDelete: string[] = [];
|
const objectsToDelete: string[] = [];
|
||||||
|
let knownCount = 0;
|
||||||
for (const id in this.hassObjects) {
|
for (const id in this.hassObjects) {
|
||||||
if (
|
if (
|
||||||
Object.prototype.hasOwnProperty.call(this.hassObjects, id) &&
|
Object.prototype.hasOwnProperty.call(this.hassObjects, id) &&
|
||||||
id.startsWith(`${this.namespace}.entities.`) &&
|
id.startsWith(`${this.namespace}.entities.`)
|
||||||
!expectedObjects.has(id)
|
|
||||||
) {
|
) {
|
||||||
|
knownCount++;
|
||||||
|
if (!expectedObjects.has(id)) {
|
||||||
objectsToDelete.push(id);
|
objectsToDelete.push(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Sanity guard: if HASS returned a drastically smaller entity set than what we
|
||||||
|
// know (e.g. mid-startup after a restart), assume the data is incomplete and
|
||||||
|
// skip deletion. The next sync will retry.
|
||||||
|
if (knownCount > 10 && objectsToDelete.length > knownCount / 2) {
|
||||||
|
this.log.warn(
|
||||||
|
`Skipping deletion of ${objectsToDelete.length}/${knownCount} stale objects — HASS likely returned an incomplete state list. Will retry on next sync.`,
|
||||||
|
);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
let deletedCount = 0;
|
||||||
for (const id of objectsToDelete) {
|
for (const id of objectsToDelete) {
|
||||||
try {
|
try {
|
||||||
|
// Never auto-delete objects that hold user configuration like
|
||||||
|
// common.custom (history/influxdb/sql adapter settings) — losing
|
||||||
|
// those silently on a transient HASS hiccup would force the user
|
||||||
|
// to recreate them. See issue #165.
|
||||||
|
const existing = await this.getForeignObjectAsync(id);
|
||||||
|
const custom = (existing?.common as { custom?: Record<string, unknown> } | undefined)?.custom;
|
||||||
|
if (custom && Object.keys(custom).length) {
|
||||||
|
this.log.debug(`Keeping "${id}" despite being stale: object holds custom adapter configuration`);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
await this.delObjectAsync(id);
|
await this.delObjectAsync(id);
|
||||||
delete this.hassObjects[id];
|
delete this.hassObjects[id];
|
||||||
|
deletedCount++;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
this.log.error(`Error deleting object ${id}: ${err}`);
|
this.log.error(`Error deleting object ${id}: ${err}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return objectsToDelete.length;
|
return deletedCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async parseStates(entities: HassEntity[], services: HassServices): Promise<void> {
|
private async parseStates(entities: HassEntity[], services: HassServices): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user