iobroker.tidy 0.1.5 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
 
10
10
  [![COMMUNITY](https://img.shields.io/badge/community%20-ioBroker%20|%20forum-blue.svg)](https://forum.iobroker.net/topic/84331/tidy-adapter-alpha)
11
11
  [![MAINTAINER](https://img.shields.io/badge/maintainer-skvarel%20@%20inventwo-yellowgreen.svg)](https://github.com/skvarel)
12
- [![AI](https://img.shields.io/badge/ai%20assisted-cursor-blue.svg)](https://github.com/inventwo/ioBroker.tidy/blob/main/.cursor/rules/iobroker-adapter.mdc)
12
+ [![AI](https://img.shields.io/badge/ai%20assisted-cursor-blue.svg)](https://github.com/inventwo/ioBroker.tidy/blob/main/.cursor/iobroker-adapter.mdc)
13
13
 
14
14
  [![Paypal Donation](https://img.shields.io/badge/paypal-donate%20|%20spenden-green.svg)](https://www.paypal.com/donate/?hosted_button_id=7W6M3TFZ4W9LW)
15
15
 
@@ -31,6 +31,8 @@ The **Tidy** adapter helps to find unused objects and states to clean up your sy
31
31
  - Configurable age thresholds for "stale" and "dead" detection
32
32
  - Optional automatic scanning at configurable intervals (hourly)
33
33
  - Enable/disable individual scan paths
34
+ - Optional complete scan of the entire object tree
35
+ - **🌐 Complete scan**: Scan all states in the system (not limited to configured paths) via a separate result channel
34
36
  - **🎯 Manual triggers**: Each configured path gets a trigger button to run scans on demand
35
37
  - **📋 JSON table output**: Results are provided as JSON arrays, perfect for table widgets in VIS
36
38
  - **📈 Statistics**: Automatic counters for total, dead, stale, and orphaned datapoints
@@ -40,6 +42,7 @@ The **Tidy** adapter helps to find unused objects and states to clean up your sy
40
42
  ### General Settings
41
43
 
42
44
  - **Enable automatic scans**: When enabled, all configured paths are scanned automatically
45
+ - **Scan all objects (complete)**: When enabled, the adapter scans the entire object tree and stores results in a separate `complete` channel (see below)
43
46
  - **Scan interval**: How often automatic scans should run (in hours, minimum 1)
44
47
  - **Days until 'stale'**: Datapoints not updated for this many days are marked as stale (warning)
45
48
  - **Days until 'dead'**: Datapoints not updated for this many days are marked as dead (critical)
@@ -65,6 +68,18 @@ For each configured path (e.g., "userdata"), the adapter creates:
65
68
  - **`tidy.0.userdata.staleCount`** (number): Number of stale datapoints
66
69
  - **`tidy.0.userdata.orphanedCount`** (number): Number of orphaned aliases
67
70
 
71
+ When **Scan all objects (complete)** is enabled in the general settings, the adapter additionally creates:
72
+
73
+ - **`tidy.0.complete.trigger`** (button): Click to manually start a complete scan
74
+ - **`tidy.0.complete.result`** (json): Scan results for all states in the system
75
+ - **`tidy.0.complete.lastScan`** (timestamp): When the last complete scan was performed
76
+ - **`tidy.0.complete.count`** (number): Total datapoints found
77
+ - **`tidy.0.complete.deadCount`** (number): Number of dead datapoints
78
+ - **`tidy.0.complete.staleCount`** (number): Number of stale datapoints
79
+ - **`tidy.0.complete.orphanedCount`** (number): Number of orphaned aliases
80
+
81
+ The complete scan uses the same JSON result structure as path-based scans. Automatic scans include the complete scan when this option is enabled.
82
+
68
83
  ### JSON Result Structure
69
84
 
70
85
  The `result` state contains a JSON array with the following fields for each datapoint:
@@ -132,6 +147,15 @@ Use the JSON result with a table widget to display and sort your datapoints:
132
147
  4. Sort by `last_ts` (oldest first) to find the "deadest" datapoints
133
148
  5. Filter by `issue != null` to show only problematic datapoints
134
149
 
150
+ ### Complete Scan
151
+
152
+ 1. Enable **Scan all objects (complete)** in the general settings
153
+ 2. Save configuration — the adapter performs an initial complete scan
154
+ 3. View results in `tidy.0.complete.result`
155
+ 4. Use `tidy.0.complete.trigger` for manual rescans at any time
156
+
157
+ Use the complete scan to get an overview of all states in your instance. For targeted cleanup, path-based scans (e.g. `0_userdata.0`, `alias.0`) are usually more practical.
158
+
135
159
  ### Automatic Maintenance
136
160
 
137
161
  1. Enable "automatic scans" in settings
@@ -150,6 +174,18 @@ If you like our work and would like to support us, we appreciate any donation.
150
174
  <!--
151
175
  ### **WORK IN PROGRESS**
152
176
  -->
177
+ ### 0.1.7 (2026-06-07)
178
+ - (skvarel) Migrated project rules from GitHub Copilot to Cursor rules
179
+ - (skvarel) Fixed adapter checker warning for automatic scan interval
180
+
181
+ ### 0.1.6 (2026-05-31)
182
+ - (skvarel) Fixed scan when path name is left empty (result states now use path as fallback)
183
+ - (skvarel) Added default for scan-all-objects option in adapter configuration
184
+ - (skvarel) Fixed incorrect link to Cursor project rules in README
185
+ - (skvarel) Unified issue tracker URL to inventwo repository
186
+ - (skvarel) Fixed type-check script for local development
187
+ - (skvarel) Documented complete scan feature in README
188
+
153
189
  ### 0.1.5 (2026-05-29)
154
190
  - (skvarel) Updated dependencies
155
191
  - (skvarel) Fixed repo checker issue
@@ -160,13 +196,6 @@ If you like our work and would like to support us, we appreciate any donation.
160
196
  ### 0.1.3 (2026-05-24)
161
197
  - (skvarel) Fixed repo checker issue
162
198
 
163
- ### 0.1.1 (2026-04-18)
164
- - (skvarel) Changed name of result field to optional
165
- - (skvarel) Revised config
166
-
167
- ### 0.1.0 (2026-04-17)
168
- - (skvarel) Added option for complete scan
169
-
170
199
  ## Older changes
171
200
  - [CHANGELOG_OLD.md](CHANGELOG_OLD.md)
172
201
 
package/io-package.json CHANGED
@@ -1,8 +1,34 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "tidy",
4
- "version": "0.1.5",
4
+ "version": "0.1.7",
5
5
  "news": {
6
+ "0.1.7": {
7
+ "en": "Migrated project rules from GitHub Copilot to Cursor rules\nFixed adapter checker warning for automatic scan interval",
8
+ "de": "Geförderte Projektregeln von GitHub Copilot zu Cursor-Regeln\nFeste Adapter-Checker-Warnung für automatisches Scanintervall",
9
+ "ru": "Миграционные правила проекта от GitHub Copilot до Cursor\nПредупреждение о проверке адаптера для автоматического интервала сканирования",
10
+ "pt": "Regras de projeto modificadas do Copiloto GitHub para as regras do Cursor\nAviso de verificação fixa do adaptador para intervalo de varredura automática",
11
+ "nl": "Migrated project regels van GitHub Copilot naar Cursor regels\nWaarschuwing voor vaste adaptercontrole voor automatisch scaninterval",
12
+ "fr": "Règles de projet modifiées du copilote GitHub aux règles Cursor\nAvertissement de vérification de l'adaptateur fixe pour l'intervalle de balayage automatique",
13
+ "it": "Regole di progetto migrate da GitHub Copilot a regole Cursor\nAvvertenza a scacchi per adattatore fisso per intervallo di scansione automatico",
14
+ "es": "Migrated project rules from GitHub Copilot to Cursor rules\nAviso de control de adaptador fijo para intervalo de escaneo automático",
15
+ "pl": "Migrowane zasady projektu z GitHub Copilot do zasad kursora\nOstrzeżenie dotyczące automatycznego skanowania",
16
+ "uk": "Миттєві правила проекту від GitHub Copilot до правил Cursor\nВиправлено попередження перевірки адаптера для автоматичного інтервалу сканування",
17
+ "zh-cn": "从 GitHub 副驾驶到光标规则\n自动扫描间隔的固定适配器检查器警告"
18
+ },
19
+ "0.1.6": {
20
+ "en": "Fixed scan when path name is left empty (result states now use path as fallback)\nAdded default for scan-all-objects option in adapter configuration\nFixed incorrect link to Cursor project rules in README\nUnified issue tracker URL to inventwo repository\nFixed type-check script for local development\nDocumented complete scan feature in README",
21
+ "de": "Behobener Scan, wenn der Pfadname leer gelassen wird (Ergebnisse Zustände verwenden nun Pfad als Fallback)\nStandard für Scan-all-Objekte Option in Adapterkonfiguration hinzugefügt\nFehlerhafte Verknüpfung mit Cursor-Projektregeln in README behoben\nUnified Ausgabe Tracker URL zu erfindenwo Repository\nFixed Type-Check-Skript für lokale Entwicklung\nDokumentierte vollständige Scan-Funktion in README",
22
+ "ru": "Исправленное сканирование, когда имя пути оставлено пустым (в результате состояния теперь используют путь в качестве резерва)\nДобавлено по умолчанию для опции сканирования всех объектов в конфигурации адаптера\nИсправлена неправильная ссылка на правила проекта Cursor в README\nUnified Issue Tracker URL для создания репозитория\nФиксированный скрипт проверки типа для локальной разработки\nПолная функция сканирования в README",
23
+ "pt": "Varredura fixa quando o nome do caminho fica vazio (os estados de resultado agora usam o caminho como recuo)\nAdicionado por omissão para a opção scan-all-objects na configuração do adaptador\nLigação incorreta fixa às regras do projeto Cursor no README\nURL unificado do rastreador de problemas para inventar o repositório\nPrograma de verificação de tipo fixo para desenvolvimento local\nFuncionalidade de digitalização completa documentada no README",
24
+ "nl": "Fixed scan wanneer padnaam leeg gelaten wordt (resultaattoestanden gebruiken nu pad als terugval)\nStandaard toegevoegd voor optie scan-all-objecten in adapterconfiguratie\nOnjuiste link naar Cursor-projectregels in README\nUnified issue tracker URL naar inventwo repository\nVast typecontrolescript voor lokale ontwikkeling\nGedocumenteerde volledige scanfunctie in README",
25
+ "fr": "Correction de l'analyse lorsque le nom du chemin est laissé vide (les états de résultat utilisent maintenant le chemin comme retour)\nAjout par défaut de l'option scanner tous les objets dans la configuration de l'adaptateur\nCorrection d'un lien incorrect vers les règles du projet Cursor dans README\nURL de tracker de problèmes unifiée vers le dépôt inventwo\nCorrection du script de vérification de type pour le développement local\nFonction de numérisation complète documentée dans README",
26
+ "it": "Controllo fisso quando il nome del percorso viene lasciato vuoto (i risultati ora usano il percorso come fallback)\nAggiunta di default per scan-all-objects opzione nella configurazione dell'adattatore\nFisso collegamento errato alle regole del progetto Cursor in README\nURL del tracciatore di numeri unificato inventwo repository\nScript di controllo del tipo fisso per lo sviluppo locale\nFunzione di scansione completa documentata in README",
27
+ "es": "Escaneo fijo cuando el nombre de la ruta queda vacío (resulta estados ahora utilizan la ruta como retroceso)\nAñadido predeterminado para la opción Scan-all-objects en la configuración del adaptador\nEnlace incorrecto fijo a las reglas del proyecto Cursor en README\nUnified issue tracker URL para inventwo repository\nScript de comprobación de tipo fijo para el desarrollo local\nFunción de exploración completa documentada en README",
28
+ "pl": "Naprawiono skanowanie, gdy nazwa ścieżki jest pusta (stan wyniku używa ścieżki jako zapasu)\nDodano domyślne dla opcji scan- all- objects w konfiguracji adaptera\nNaprawiono nieprawidłowe łącze do zasad projektu kursora w README\nUnified issue tracker URL do wynalazku dwóch repozytorium\nStałe skrypty sprawdzania typu dla rozwoju lokalnego\nKompletna funkcja skanowania w README",
29
+ "uk": "Виправлено сканування, коли ім'я шляху залишається порожнім (результні стани тепер використовують шлях як випадання)\nДодано за замовчуванням для налаштування скан-all-objects\nВиправлено некоректне посилання на правила проекту Cursor в README\nУніфікований URL-адреса трекера для inventwo repository\nВиправлений сценарій типу-подібним вирізом для місцевого розвитку\nФункція повного сканування документів в README",
30
+ "zh-cn": "当路径名称为空时进行固定扫描( 结果状态现在使用路径作为倒置)\n在适配器配置中添加了扫描全部对象选项的默认值\n与 README 中的光标项目规则的固定错误链接\n统一问题跟踪器 URL 到 Inventwo 仓库\n本地开发的固定类型检查脚本\n在 README 中记录了完整的扫描功能"
31
+ },
6
32
  "0.1.5": {
7
33
  "en": "Updated dependencies\nFixed repo checker issue",
8
34
  "de": "Aktualisierte Abhängigkeiten\nProblem der Repo Checker behoben",
@@ -67,19 +93,6 @@
67
93
  "pl": "Dodano opcję do pełnego skanowania",
68
94
  "uk": "Додано варіант для повного сканування",
69
95
  "zh-cn": "添加完整扫描选项"
70
- },
71
- "0.0.1": {
72
- "en": "initial release",
73
- "de": "Erstveröffentlichung",
74
- "ru": "Начальная версия",
75
- "pt": "lançamento inicial",
76
- "nl": "Eerste uitgave",
77
- "fr": "Première version",
78
- "it": "Versione iniziale",
79
- "es": "Versión inicial",
80
- "pl": "Pierwsze wydanie",
81
- "uk": "Початкова версія",
82
- "zh-cn": "首次出版"
83
96
  }
84
97
  },
85
98
  "titleLang": {
@@ -148,6 +161,7 @@
148
161
  },
149
162
  "native": {
150
163
  "autoScan": false,
164
+ "scanAllObjects": false,
151
165
  "scanInterval": 24,
152
166
  "daysUntilStale": 90,
153
167
  "daysUntilDead": 365,
package/main.js CHANGED
@@ -59,7 +59,7 @@ class Tidy extends utils.Adapter {
59
59
  if (this.config.autoScan && this.config.scanInterval > 0) {
60
60
  const intervalMs = this.config.scanInterval * 60 * 60 * 1000; // Convert hours to milliseconds
61
61
  this.log.info(`Automatic scanning enabled: Every ${this.config.scanInterval} hour(s)`);
62
- this.scanInterval = setInterval(async () => {
62
+ this.scanInterval = this.setInterval(async () => {
63
63
  this.log.info('Running automatic scan...');
64
64
  await this.scanAllPaths();
65
65
  if (this.config.scanAllObjects) {
@@ -231,7 +231,7 @@ class Tidy extends utils.Adapter {
231
231
  try {
232
232
  // Clear automatic scan interval
233
233
  if (this.scanInterval) {
234
- clearInterval(this.scanInterval);
234
+ this.clearInterval(this.scanInterval);
235
235
  this.scanInterval = undefined;
236
236
  }
237
237
 
@@ -251,9 +251,7 @@ class Tidy extends utils.Adapter {
251
251
  continue;
252
252
  }
253
253
 
254
- // Fallback: use path if name is empty
255
- const effectiveName = pathConfig.name && pathConfig.name.trim() ? pathConfig.name : pathConfig.path;
256
- const channelId = this.sanitizeName(effectiveName);
254
+ const channelId = this.getChannelId(pathConfig);
257
255
 
258
256
  // Create channel
259
257
  await this.setObjectNotExistsAsync(channelId, {
@@ -392,9 +390,7 @@ class Tidy extends utils.Adapter {
392
390
  // Find the corresponding path config
393
391
  const channelId = id.replace(`${this.namespace}.`, '').replace('.trigger', '');
394
392
  // Fallback: match also if name is empty and path is used
395
- const pathConfig = this.config.paths.find(
396
- p => this.sanitizeName(p.name && p.name.trim() ? p.name : p.path) === channelId,
397
- );
393
+ const pathConfig = this.config.paths.find(p => this.getChannelId(p) === channelId);
398
394
 
399
395
  if (pathConfig && pathConfig.enabled) {
400
396
  await this.scanPath(pathConfig);
@@ -415,7 +411,7 @@ class Tidy extends utils.Adapter {
415
411
  */
416
412
  async scanAllPaths() {
417
413
  for (const pathConfig of this.config.paths) {
418
- if (pathConfig.enabled) {
414
+ if (pathConfig.enabled && (pathConfig.name || pathConfig.path)) {
419
415
  await this.scanPath(pathConfig);
420
416
  }
421
417
  }
@@ -431,7 +427,7 @@ class Tidy extends utils.Adapter {
431
427
  this.log.info(`Scanning path: ${pathConfig.path}`);
432
428
 
433
429
  try {
434
- const channelId = this.sanitizeName(pathConfig.name);
430
+ const channelId = this.getChannelId(pathConfig);
435
431
  const results = [];
436
432
 
437
433
  // Get all objects under the specified path
@@ -575,6 +571,17 @@ class Tidy extends utils.Adapter {
575
571
  return result;
576
572
  }
577
573
 
574
+ /**
575
+ * Resolve channel ID from path config (name with fallback to path)
576
+ *
577
+ * @param {object} pathConfig - Path configuration object
578
+ * @returns {string} Sanitized channel ID
579
+ */
580
+ getChannelId(pathConfig) {
581
+ const effectiveName = pathConfig.name && pathConfig.name.trim() ? pathConfig.name : pathConfig.path;
582
+ return this.sanitizeName(effectiveName);
583
+ }
584
+
578
585
  /**
579
586
  * Sanitize name for use as object ID
580
587
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.tidy",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Analyzes ioBroker objects for unused datapoints and helps you clean up your instance",
5
5
  "author": {
6
6
  "name": "skvarel",
@@ -31,7 +31,7 @@
31
31
  "@iobroker/adapter-core": "^3.3.2"
32
32
  },
33
33
  "devDependencies": {
34
- "@alcalzone/release-script": "^5.2.0",
34
+ "@alcalzone/release-script": "^5.2.1",
35
35
  "@alcalzone/release-script-plugin-iobroker": "^5.2.0",
36
36
  "@alcalzone/release-script-plugin-license": "^5.2.0",
37
37
  "@alcalzone/release-script-plugin-manual-review": "^5.2.0",
@@ -49,7 +49,6 @@
49
49
  "admin{,/!(src)/**}/!(tsconfig|tsconfig.*|.eslintrc).{json,json5}",
50
50
  "admin{,/!(src)/**}/*.{html,css,png,svg,jpg,js}",
51
51
  "lib/",
52
- "www/",
53
52
  "io-package.json",
54
53
  "LICENSE",
55
54
  "main.js"
@@ -70,7 +69,7 @@
70
69
  "dev-server:stop": "powershell -NonInteractive -Command \"Get-NetTCPConnection -LocalPort 8091,26436,24436,20436 -EA SilentlyContinue | Select-Object -ExpandProperty OwningProcess -Unique | ForEach-Object { Stop-Process -Id $_ -Force -EA SilentlyContinue }; Write-Host 'dev-server stopped'\""
71
70
  },
72
71
  "bugs": {
73
- "url": "https://github.com/skvarel/ioBroker.tidy/issues"
72
+ "url": "https://github.com/inventwo/ioBroker.tidy/issues"
74
73
  },
75
74
  "readmeFilename": "README.md"
76
75
  }