iobroker.tidy 0.1.5 → 0.1.6
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 +33 -4
- package/io-package.json +15 -1
- package/main.js +15 -8
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
[](https://forum.iobroker.net/topic/84331/tidy-adapter-alpha)
|
|
11
11
|
[](https://github.com/skvarel)
|
|
12
|
-
[](https://github.com/inventwo/ioBroker.tidy/blob/main/.cursor/
|
|
12
|
+
[](https://github.com/inventwo/ioBroker.tidy/blob/main/.cursor/iobroker-adapter.mdc)
|
|
13
13
|
|
|
14
14
|
[](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,14 @@ 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.6 (2026-05-31)
|
|
178
|
+
- (skvarel) Fixed scan when path name is left empty (result states now use path as fallback)
|
|
179
|
+
- (skvarel) Added default for scan-all-objects option in adapter configuration
|
|
180
|
+
- (skvarel) Fixed incorrect link to Cursor project rules in README
|
|
181
|
+
- (skvarel) Unified issue tracker URL to inventwo repository
|
|
182
|
+
- (skvarel) Fixed type-check script for local development
|
|
183
|
+
- (skvarel) Documented complete scan feature in README
|
|
184
|
+
|
|
153
185
|
### 0.1.5 (2026-05-29)
|
|
154
186
|
- (skvarel) Updated dependencies
|
|
155
187
|
- (skvarel) Fixed repo checker issue
|
|
@@ -164,9 +196,6 @@ If you like our work and would like to support us, we appreciate any donation.
|
|
|
164
196
|
- (skvarel) Changed name of result field to optional
|
|
165
197
|
- (skvarel) Revised config
|
|
166
198
|
|
|
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,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "tidy",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.1.6": {
|
|
7
|
+
"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",
|
|
8
|
+
"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",
|
|
9
|
+
"ru": "Исправленное сканирование, когда имя пути оставлено пустым (в результате состояния теперь используют путь в качестве резерва)\nДобавлено по умолчанию для опции сканирования всех объектов в конфигурации адаптера\nИсправлена неправильная ссылка на правила проекта Cursor в README\nUnified Issue Tracker URL для создания репозитория\nФиксированный скрипт проверки типа для локальной разработки\nПолная функция сканирования в README",
|
|
10
|
+
"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",
|
|
11
|
+
"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",
|
|
12
|
+
"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",
|
|
13
|
+
"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",
|
|
14
|
+
"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",
|
|
15
|
+
"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",
|
|
16
|
+
"uk": "Виправлено сканування, коли ім'я шляху залишається порожнім (результні стани тепер використовують шлях як випадання)\nДодано за замовчуванням для налаштування скан-all-objects\nВиправлено некоректне посилання на правила проекту Cursor в README\nУніфікований URL-адреса трекера для inventwo repository\nВиправлений сценарій типу-подібним вирізом для місцевого розвитку\nФункція повного сканування документів в README",
|
|
17
|
+
"zh-cn": "当路径名称为空时进行固定扫描( 结果状态现在使用路径作为倒置)\n在适配器配置中添加了扫描全部对象选项的默认值\n与 README 中的光标项目规则的固定错误链接\n统一问题跟踪器 URL 到 Inventwo 仓库\n本地开发的固定类型检查脚本\n在 README 中记录了完整的扫描功能"
|
|
18
|
+
},
|
|
6
19
|
"0.1.5": {
|
|
7
20
|
"en": "Updated dependencies\nFixed repo checker issue",
|
|
8
21
|
"de": "Aktualisierte Abhängigkeiten\nProblem der Repo Checker behoben",
|
|
@@ -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
|
@@ -251,9 +251,7 @@ class Tidy extends utils.Adapter {
|
|
|
251
251
|
continue;
|
|
252
252
|
}
|
|
253
253
|
|
|
254
|
-
|
|
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.
|
|
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.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Analyzes ioBroker objects for unused datapoints and helps you clean up your instance",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "skvarel",
|
|
@@ -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/
|
|
72
|
+
"url": "https://github.com/inventwo/ioBroker.tidy/issues"
|
|
74
73
|
},
|
|
75
74
|
"readmeFilename": "README.md"
|
|
76
75
|
}
|