Compare commits

...
32 Commits
Author SHA1 Message Date
GermanBluefox 0d39cc9d1d chore: release v2.0.4
* (@GermanBluefox) Tried to keep the custom settings of the objects when updating them with new data from HASS
2026-05-05 14:31:50 +02:00
github-actions[bot]andGitHub c0defc48a5 Merge pull request #171 from ioBroker/dependabot/npm_and_yarn/axios-1.16.0
chore(deps-dev): bump axios from 1.15.0 to 1.16.0
2026-05-05 09:00:06 +00:00
dependabot[bot]andGitHub d525d5b26b chore(deps-dev): bump axios from 1.15.0 to 1.16.0
Bumps [axios](https://github.com/axios/axios) from 1.15.0 to 1.16.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.15.0...v1.16.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.16.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-05 08:05:56 +00:00
GermanBluefox a64ef243f0 Tried to keep the custom settings of the objects when updating them with new data from HASS 2026-05-05 10:01:38 +02:00
github-actions[bot]andGitHub 9a24c2be91 Merge pull request #163 from ioBroker/dependabot/npm_and_yarn/protobufjs-7.5.5
chore(deps-dev): bump protobufjs from 7.5.4 to 7.5.5
2026-04-17 06:04:54 +00:00
dependabot[bot]andGitHub d541114da1 chore(deps-dev): bump protobufjs from 7.5.4 to 7.5.5
Bumps [protobufjs](https://github.com/protobufjs/protobuf.js) from 7.5.4 to 7.5.5.
- [Release notes](https://github.com/protobufjs/protobuf.js/releases)
- [Changelog](https://github.com/protobufjs/protobuf.js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/protobufjs/protobuf.js/compare/protobufjs-v7.5.4...protobufjs-v7.5.5)

---
updated-dependencies:
- dependency-name: protobufjs
  dependency-version: 7.5.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-17 05:34:02 +00:00
github-actions[bot]andGitHub eb7b8b0e68 Merge pull request #162 from ioBroker/dependabot/npm_and_yarn/follow-redirects-1.16.0
chore(deps-dev): bump follow-redirects from 1.15.11 to 1.16.0
2026-04-15 20:07:41 +00:00
dependabot[bot]andGitHub e139c9bc27 chore(deps-dev): bump follow-redirects from 1.15.11 to 1.16.0
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.11 to 1.16.0.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.11...v1.16.0)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-version: 1.16.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-15 19:06:08 +00:00
github-actions[bot]andGitHub 40550a747b Merge pull request #161 from ioBroker/dependabot/npm_and_yarn/axios-1.15.0
Bump axios from 1.14.0 to 1.15.0
2026-04-12 11:57:13 +00:00
dependabot[bot]andGitHub 9a886b1155 Bump axios from 1.14.0 to 1.15.0
Bumps [axios](https://github.com/axios/axios) from 1.14.0 to 1.15.0.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.14.0...v1.15.0)

---
updated-dependencies:
- dependency-name: axios
  dependency-version: 1.15.0
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-12 11:55:15 +00:00
GermanBluefox 039e856f7a Merge remote-tracking branch 'origin/master'
# Conflicts:
#	io-package.json
2026-04-02 10:32:44 +02:00
GermanBluefox 06cdfbd9e4 chore: release v2.0.3
* (@GermanBluefox) Adapter was updated and migrated to TypeScript
* (@Titanium177) Added roles for states and added debouncing for reading states from hass
2026-04-02 10:32:32 +02:00
GermanBluefox e92d488529 Bump version 2026-04-02 10:32:19 +02:00
BluefoxandGitHub d5f874cf84 Merge pull request #137 from ioBroker-Bot/update-from-template-W1081-addLicenseInformation-1762607726
[iobroker-bot] Add license information to io-package.json
2026-03-31 22:23:15 +02:00
BluefoxandGitHub 952680454b Merge branch 'master' into update-from-template-W1081-addLicenseInformation-1762607726 2026-03-31 22:23:05 +02:00
BluefoxandGitHub c4fb2d37aa Merge pull request #136 from ioBroker-Bot/update-from-template-S9006-blockCommitinfo-1760888564
[iobroker-bot] Block .commitinfo by adding to .gitignore
2026-03-31 22:22:29 +02:00
BluefoxandGitHub 1f06d5afac Merge branch 'master' into update-from-template-S9006-blockCommitinfo-1760888564 2026-03-31 22:22:21 +02:00
BluefoxandGitHub a64edae70c Merge pull request #154 from ioBroker/dependabot/github_actions/github/codeql-action-4
Bump github/codeql-action from 2 to 4
2026-03-31 22:21:57 +02:00
BluefoxandGitHub 477e910371 Merge pull request #153 from ioBroker/dependabot/github_actions/actions/checkout-6
Bump actions/checkout from 4 to 6
2026-03-31 22:21:49 +02:00
BluefoxandGitHub 959a5f7a3f Merge pull request #146 from ioBroker-Bot/update-from-template-X0000-updateNodeJsAtTestAndRelease-1772981360
[iobroker-bot] Update Node.js versions in test-and-release workflow
2026-03-31 22:21:06 +02:00
dependabot[bot]andGitHub 90f53d8ce8 Bump github/codeql-action from 2 to 4
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-31 20:15:54 +00:00
BluefoxandGitHub 360baf112e Merge pull request #141 from ioBroker-Bot/update-from-template-W1084-removeCommonTitle-1765837585
[iobroker-bot] Remove deprecated common.title from io-package.json
2026-03-31 22:15:52 +02:00
dependabot[bot]andGitHub 164a8c6bee Bump actions/checkout from 4 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-03-31 20:15:45 +00:00
BluefoxandGitHub 89a588b73d Merge branch 'master' into update-from-template-W1084-removeCommonTitle-1765837585 2026-03-31 22:15:39 +02:00
BluefoxandGitHub 36f296ee8f Merge pull request #139 from ioBroker-Bot/update-from-template-X0000-randomDependabot-1762823480
[iobroker-bot] Optimize Dependabot Schedule Configuration
2026-03-31 22:15:10 +02:00
BluefoxandGitHub b9e92864a0 Merge pull request #144 from ioBroker-Bot/update-from-template-X0000-setupAutomergeDependabot-1768922970
[iobroker-bot] Setup Auto-Merge for Dependabot PRs
2026-03-31 22:14:34 +02:00
github-actions[bot] 1ed00c8778 Update from template: X0000-updateNodeJsAtTestAndRelease 2026-03-08 14:49:50 +00:00
github-actions[bot] d1442504e8 Update from template: X0000-setupAutomergeDependabot 2026-01-20 15:30:00 +00:00
github-actions[bot] 2ca9828262 Update from template: W1084-removeCommonTitle 2025-12-15 22:26:56 +00:00
github-actions[bot] 2e78c1f42b Update from template: X0000-randomDependabot 2025-11-11 01:11:50 +00:00
github-actions[bot] 8dbde9bbcb Update from template: W1081-addLicenseInformation 2025-11-08 13:15:57 +00:00
github-actions[bot] 1b6d9bbeea Update from template: S9006-blockCommitinfo 2025-10-19 15:43:14 +00:00
11 changed files with 138 additions and 68 deletions
+14 -10
View File
@@ -1,16 +1,20 @@
# Dependabot will run on day 17 of each month at 02:15 (Europe/Berlin timezone)
version: 2
updates:
- package-ecosystem: github-actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: monthly
time: "04:00"
timezone: Europe/Berlin
- package-ecosystem: npm
interval: "cron"
timezone: "Europe/Berlin"
cronjob: "15 2 17 * *"
open-pull-requests-limit: 15
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: monthly
time: "04:00"
timezone: Europe/Berlin
open-pull-requests-limit: 5
versioning-strategy: increase
interval: "cron"
timezone: "Europe/Berlin"
cronjob: "15 2 17 * *"
open-pull-requests-limit: 15
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'
+4 -4
View File
@@ -24,18 +24,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v4
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"
+4 -2
View File
@@ -28,7 +28,7 @@ jobs:
steps:
- uses: ioBroker/testing-action-check@v1
with:
node-version: '22.x'
node-version: '24.x'
lint: true
adapter-tests:
@@ -47,6 +47,7 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
os: ${{ matrix.os }}
build: true
deploy:
needs: [check-and-lint, adapter-tests]
@@ -66,5 +67,6 @@ jobs:
steps:
- uses: ioBroker/testing-action-deploy@v1
with:
node-version: '22.x'
node-version: '24.x'
github-token: ${{ secrets.GITHUB_TOKEN }}
build: true
+3
View File
@@ -6,4 +6,7 @@ admin/i18n/flat.txt
admin/i18n/*/flat.txt
iob_npm.done
package-lock.json
#ignore .commitinfo created by ioBroker release script
.commitinfo
.claude/settings.local.json
+4 -1
View File
@@ -106,7 +106,10 @@ Please check it https://www.smarthomejetzt.de/mit-iobroker-auf-eine-home-assista
-->
## 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
* (@Titanium177) Added roles for states and added debouncing for reading states from hass
+19 -16
View File
@@ -1,7 +1,7 @@
{
"common": {
"name": "hass",
"version": "2.0.2",
"version": "2.0.4",
"title": "Home Assistant",
"titleLang": {
"en": "Home Assistant",
@@ -30,7 +30,20 @@
"uk": "Підключення Home Assistant для ioBroker"
},
"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",
"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Добавлены роли для штатов и добавлены отговорки для чтения штатов из хэша",
@@ -107,19 +120,6 @@
"pl": "Pokaż ponownie zamaskowane pola haseł w konfiguracji",
"zh-cn": "在配置中再次显示被屏蔽的密码字段",
"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",
@@ -131,7 +131,10 @@
"adminUI": {
"config": "json"
},
"license": "MIT",
"licenseInformation": {
"type": "free",
"license": "MIT"
},
"extIcon": "https://raw.githubusercontent.com/ioBroker/ioBroker.hass/master/admin/hass.png",
"keywords": [
"HASS",
+23 -27
View File
@@ -1,12 +1,12 @@
{
"name": "iobroker.hass",
"version": "2.0.2",
"version": "2.0.4",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "iobroker.hass",
"version": "2.0.2",
"version": "2.0.4",
"license": "MIT",
"dependencies": {
"@iobroker/adapter-core": "^3.3.2",
@@ -21,8 +21,7 @@
"@iobroker/eslint-config": "^2.2.0",
"@iobroker/legacy-testing": "^2.0.2",
"@iobroker/testing": "^5.2.2",
"@types/ws": "^8.18.1",
"mocha": "^11.7.5"
"@types/ws": "^8.18.1"
}
},
"node_modules/@alcalzone/esbuild-register": {
@@ -2578,13 +2577,12 @@
}
},
"node_modules/axios": {
"version": "1.14.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.14.0.tgz",
"integrity": "sha512-3Y8yrqLSwjuzpXuZ0oIYZ/XGgLwUIBU3uLvbcpb0pidD9ctpShJd43KSlEEkVQg6DS0G9NKyzOvBfUtDKEyHvQ==",
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.16.0.tgz",
"integrity": "sha512-6hp5CwvTPlN2A31g5dxnwAX0orzM7pmCRDLnZSX772mv8WDqICwFjowHuPs04Mc8deIld1+ejhtaMn5vp6b+1w==",
"dev": true,
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.11",
"follow-redirects": "^1.16.0",
"form-data": "^4.0.5",
"proxy-from-env": "^2.1.0"
}
@@ -4442,9 +4440,9 @@
"license": "ISC"
},
"node_modules/follow-redirects": {
"version": "1.15.11",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
"integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
"integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==",
"dev": true,
"funding": [
{
@@ -4452,7 +4450,6 @@
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"license": "MIT",
"engines": {
"node": ">=4.0"
},
@@ -6649,12 +6646,11 @@
}
},
"node_modules/protobufjs": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz",
"integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==",
"version": "7.5.5",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.5.tgz",
"integrity": "sha512-3wY1AxV+VBNW8Yypfd1yQY9pXnqTAN+KwQxL8iYm3/BjKYMNg4i0owhEe26PWDOMaIrzeeF98Lqd5NGz4omiIg==",
"dev": true,
"hasInstallScript": true,
"license": "BSD-3-Clause",
"dependencies": {
"@protobufjs/aspromise": "^1.1.2",
"@protobufjs/base64": "^1.1.2",
@@ -9723,12 +9719,12 @@
}
},
"axios": {
"version": "1.14.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.14.0.tgz",
"integrity": "sha512-3Y8yrqLSwjuzpXuZ0oIYZ/XGgLwUIBU3uLvbcpb0pidD9ctpShJd43KSlEEkVQg6DS0G9NKyzOvBfUtDKEyHvQ==",
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-1.16.0.tgz",
"integrity": "sha512-6hp5CwvTPlN2A31g5dxnwAX0orzM7pmCRDLnZSX772mv8WDqICwFjowHuPs04Mc8deIld1+ejhtaMn5vp6b+1w==",
"dev": true,
"requires": {
"follow-redirects": "^1.15.11",
"follow-redirects": "^1.16.0",
"form-data": "^4.0.5",
"proxy-from-env": "^2.1.0"
}
@@ -11000,9 +10996,9 @@
"dev": true
},
"follow-redirects": {
"version": "1.15.11",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz",
"integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
"version": "1.16.0",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.16.0.tgz",
"integrity": "sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw==",
"dev": true
},
"for-each": {
@@ -12418,9 +12414,9 @@
}
},
"protobufjs": {
"version": "7.5.4",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.4.tgz",
"integrity": "sha512-CvexbZtbov6jW2eXAvLukXjXUW1TzFaivC46BpWc/3BpcCysb5Vffu+B3XHMm8lVEuy2Mm4XGex8hBSg1yapPg==",
"version": "7.5.5",
"resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.5.5.tgz",
"integrity": "sha512-3wY1AxV+VBNW8Yypfd1yQY9pXnqTAN+KwQxL8iYm3/BjKYMNg4i0owhEe26PWDOMaIrzeeF98Lqd5NGz4omiIg==",
"dev": true,
"requires": {
"@protobufjs/aspromise": "^1.1.2",
+2 -3
View File
@@ -1,6 +1,6 @@
{
"name": "iobroker.hass",
"version": "2.0.2",
"version": "2.0.4",
"description": "Home Assistant",
"author": {
"name": "bluefox",
@@ -37,8 +37,7 @@
"@iobroker/eslint-config": "^2.2.0",
"@iobroker/legacy-testing": "^2.0.2",
"@iobroker/testing": "^5.2.2",
"@types/ws": "^8.18.1",
"mocha": "^11.7.5"
"@types/ws": "^8.18.1"
},
"main": "build/main.js",
"files": [
+28 -3
View File
@@ -403,26 +403,51 @@ class HassAdapter extends Adapter {
private async deleteStaleObjects(expectedObjects: Set<string>): Promise<number> {
const objectsToDelete: string[] = [];
let knownCount = 0;
for (const id in this.hassObjects) {
if (
Object.prototype.hasOwnProperty.call(this.hassObjects, id) &&
id.startsWith(`${this.namespace}.entities.`) &&
!expectedObjects.has(id)
id.startsWith(`${this.namespace}.entities.`)
) {
knownCount++;
if (!expectedObjects.has(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) {
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);
delete this.hassObjects[id];
deletedCount++;
} catch (err) {
this.log.error(`Error deleting object ${id}: ${err}`);
}
}
return objectsToDelete.length;
return deletedCount;
}
private async parseStates(entities: HassEntity[], services: HassServices): Promise<void> {