iobroker.flowers 0.3.6 → 0.3.8
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 +10 -39
- package/io-package.json +27 -1
- package/main.js +76 -0
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -83,6 +83,15 @@ Only one watering cycle runs at a time per plant. Configure the duration in Sett
|
|
|
83
83
|
|
|
84
84
|
## Changelog
|
|
85
85
|
|
|
86
|
+
### 0.3.8 (2026-04-30)
|
|
87
|
+
- (sadam6752-tech) Auto-cleanup: remove ioBroker objects for plants deleted from config on adapter start
|
|
88
|
+
|
|
89
|
+
### 0.3.7 (2026-04-30)
|
|
90
|
+
- (sadam6752-tech) Fix E8915: add dependabot cooldown (`default-days: 7`) for npm ecosystem
|
|
91
|
+
- (sadam6752-tech) Update CI/CD: `check-and-lint` and `deploy` steps to Node.js 24.x
|
|
92
|
+
- (sadam6752-tech) Remove redundant `eslint` devDependency (included via `@iobroker/eslint-config`)
|
|
93
|
+
- (sadam6752-tech) Add CHANGELOG_OLD.md for older changelog entries
|
|
94
|
+
|
|
86
95
|
### 0.3.6 (2026-03-31)
|
|
87
96
|
- (sadam6752-tech) Fix dependabot config to track all package.json in subdirectories (W8905)
|
|
88
97
|
- (sadam6752-tech) Add .github/auto-merge.yml for dependabot automerge configuration (S8914)
|
|
@@ -104,45 +113,7 @@ Only one watering cycle runs at a time per plant. Configure the duration in Sett
|
|
|
104
113
|
- (sadam6752-tech) Custom profiles: users can create own plant profiles in Profiles tab
|
|
105
114
|
- (sadam6752-tech) Custom profile field in Plants table for direct profile name entry
|
|
106
115
|
|
|
107
|
-
|
|
108
|
-
- (sadam6752-tech) Fixed all lint warnings: complete JSDoc descriptions for all methods
|
|
109
|
-
|
|
110
|
-
### 0.3.0 (2026-03-30)
|
|
111
|
-
- (sadam6752-tech) Standard CI/CD workflow using ioBroker testing actions
|
|
112
|
-
- (sadam6752-tech) Added dependabot and automerge workflow
|
|
113
|
-
- (sadam6752-tech) Added release-script and standard test structure
|
|
114
|
-
- (sadam6752-tech) Added .releaseconfig.json
|
|
115
|
-
|
|
116
|
-
### 0.2.9 (2026-03-22)
|
|
117
|
-
- (sadam6752-tech) Automatic watering support: sensorWatering column, wateringDuration setting
|
|
118
|
-
- (sadam6752-tech) Fixed checkbox column width; increased battery sensor column width
|
|
119
|
-
|
|
120
|
-
### 0.2.8 (2026-03-21)
|
|
121
|
-
* (sadam6752-tech) Added sendWeeklyReport button for manual weekly report trigger
|
|
122
|
-
* (sadam6752-tech) Fixed repochecker issues: grid values, dependencies
|
|
123
|
-
|
|
124
|
-
### 0.2.7 (2026-03-21)
|
|
125
|
-
* (sadam6752-tech) Fixed weekly report header; separated daily/weekly report logic
|
|
126
|
-
|
|
127
|
-
### 0.2.6 (2026-03-21)
|
|
128
|
-
* (sadam6752-tech) Added dividers to daily/weekly report format
|
|
129
|
-
|
|
130
|
-
### 0.2.5 (2026-03-21)
|
|
131
|
-
* (sadam6752-tech) Added sendDailyReport button for manual report trigger
|
|
132
|
-
|
|
133
|
-
### 0.2.4 (2026-03-21)
|
|
134
|
-
* (sadam6752-tech) Fixed Profiles tab causing dirty state on open
|
|
135
|
-
|
|
136
|
-
### 0.2.3 (2026-03-21)
|
|
137
|
-
* (sadam6752-tech) Increased Bat Min column width; allow empty threshold fields
|
|
138
|
-
|
|
139
|
-
### 0.2.2 (2026-03-21)
|
|
140
|
-
* (sadam6752-tech) Allow empty threshold fields - profile values used as fallback
|
|
141
|
-
|
|
142
|
-
### 0.2.0 (2026-03-21)
|
|
143
|
-
* (sadam6752-tech) Added 4 new plant profiles; translations for all 11 languages
|
|
144
|
-
### 0.1.0 (2026-03-21)
|
|
145
|
-
- Initial release: plant monitoring with Telegram notifications, configurable thresholds, night mode and periodic reports
|
|
116
|
+
For older changelog entries see [CHANGELOG_OLD.md](CHANGELOG_OLD.md).
|
|
146
117
|
|
|
147
118
|
## License
|
|
148
119
|
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "flowers",
|
|
4
|
-
"version": "0.3.
|
|
4
|
+
"version": "0.3.8",
|
|
5
5
|
"news": {
|
|
6
|
+
"0.3.8": {
|
|
7
|
+
"en": "Auto-cleanup: remove ioBroker objects for plants deleted from config on adapter start",
|
|
8
|
+
"de": "Auto-Bereinigung: ioBroker-Objekte für aus der Konfiguration gelöschte Pflanzen werden beim Adapterstart entfernt",
|
|
9
|
+
"ru": "Автоочистка: объекты ioBroker для удалённых из конфига растений удаляются при старте адаптера",
|
|
10
|
+
"fr": "Nettoyage automatique: suppression des objets ioBroker pour les plantes supprimées de la config au démarrage",
|
|
11
|
+
"it": "Pulizia automatica: rimozione oggetti ioBroker per piante eliminate dalla config all'avvio",
|
|
12
|
+
"es": "Limpieza automática: eliminación de objetos ioBroker para plantas borradas de la config al iniciar",
|
|
13
|
+
"pl": "Auto-czyszczenie: usuwanie obiektów ioBroker dla roślin usuniętych z konfiguracji przy starcie",
|
|
14
|
+
"pt": "Limpeza automática: remoção de objetos ioBroker para plantas removidas da config no arranque",
|
|
15
|
+
"nl": "Auto-opruiming: ioBroker-objecten voor verwijderde planten worden bij adapterstart verwijderd",
|
|
16
|
+
"uk": "Автоочищення: об'єкти ioBroker для видалених з конфігу рослин видаляються при старті адаптера",
|
|
17
|
+
"zh-cn": "自动清理:适配器启动时删除配置中已移除植物的ioBroker对象"
|
|
18
|
+
},
|
|
19
|
+
"0.3.7": {
|
|
20
|
+
"en": "Fix E8915: add dependabot cooldown (default-days: 7); update CI/CD to Node.js 24; remove redundant eslint devDependency; add CHANGELOG_OLD.md",
|
|
21
|
+
"de": "E8915 behoben: Dependabot-Cooldown hinzugefügt; CI/CD auf Node.js 24 aktualisiert; redundante eslint devDependency entfernt; CHANGELOG_OLD.md hinzugefügt",
|
|
22
|
+
"ru": "Исправление E8915: добавлен cooldown для dependabot; CI/CD обновлён до Node.js 24; удалена лишняя devDependency eslint; добавлен CHANGELOG_OLD.md",
|
|
23
|
+
"fr": "Fix E8915: cooldown dependabot ajouté; CI/CD mis à jour vers Node.js 24; devDependency eslint redondante supprimée; CHANGELOG_OLD.md ajouté",
|
|
24
|
+
"it": "Fix E8915: aggiunto cooldown dependabot; CI/CD aggiornato a Node.js 24; devDependency eslint ridondante rimossa; aggiunto CHANGELOG_OLD.md",
|
|
25
|
+
"es": "Fix E8915: añadido cooldown dependabot; CI/CD actualizado a Node.js 24; devDependency eslint redundante eliminada; añadido CHANGELOG_OLD.md",
|
|
26
|
+
"pl": "Naprawa E8915: dodano cooldown dependabot; CI/CD zaktualizowano do Node.js 24; usunięto zbędną devDependency eslint; dodano CHANGELOG_OLD.md",
|
|
27
|
+
"pt": "Fix E8915: cooldown dependabot adicionado; CI/CD atualizado para Node.js 24; devDependency eslint redundante removida; CHANGELOG_OLD.md adicionado",
|
|
28
|
+
"nl": "Fix E8915: dependabot cooldown toegevoegd; CI/CD bijgewerkt naar Node.js 24; overbodige eslint devDependency verwijderd; CHANGELOG_OLD.md toegevoegd",
|
|
29
|
+
"uk": "Виправлення E8915: додано cooldown для dependabot; CI/CD оновлено до Node.js 24; видалено зайву devDependency eslint; додано CHANGELOG_OLD.md",
|
|
30
|
+
"zh-cn": "修复E8915:添加dependabot冷却时间;CI/CD更新至Node.js 24;删除多余的eslint devDependency;添加CHANGELOG_OLD.md"
|
|
31
|
+
},
|
|
6
32
|
"0.3.6": {
|
|
7
33
|
"en": "Fix dependabot config for subdirectories (W8905); add auto-merge.yml for dependabot (S8914)",
|
|
8
34
|
"de": "Dependabot-Konfiguration für Unterverzeichnisse korrigiert; auto-merge.yml hinzugefügt",
|
package/main.js
CHANGED
|
@@ -37,6 +37,9 @@ class FlowersAdapter extends utils.Adapter {
|
|
|
37
37
|
this.notif = new NotificationManager(this, lang);
|
|
38
38
|
this.monitor = new MonitorService(this, this.notif, lang);
|
|
39
39
|
|
|
40
|
+
// Clean up objects for plants that no longer exist in config
|
|
41
|
+
await this._cleanupRemovedPlants();
|
|
42
|
+
|
|
40
43
|
// Subscribe to sensor states
|
|
41
44
|
await this.monitor.subscribeAll();
|
|
42
45
|
|
|
@@ -137,6 +140,79 @@ class FlowersAdapter extends utils.Adapter {
|
|
|
137
140
|
callback();
|
|
138
141
|
}
|
|
139
142
|
|
|
143
|
+
// ── Cleanup removed plants ─────────────────────────────────────────────
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Delete ioBroker objects for plants that are no longer in the config.
|
|
147
|
+
* Called on adapter start to keep the object tree in sync with config.
|
|
148
|
+
*/
|
|
149
|
+
async _cleanupRemovedPlants() {
|
|
150
|
+
try {
|
|
151
|
+
// Build set of safe names for currently configured plants
|
|
152
|
+
const configuredNames = new Set(
|
|
153
|
+
(this.config.plants || []).map((p) =>
|
|
154
|
+
p.name.replace(/[^a-zA-Z0-9_]/g, "_").toLowerCase(),
|
|
155
|
+
),
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
// Get all existing objects under plants.*
|
|
159
|
+
const existingObjects = await this.getObjectViewAsync("system", "state", {
|
|
160
|
+
startkey: `${this.namespace}.plants.`,
|
|
161
|
+
endkey: `${this.namespace}.plants.\u9999`,
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
if (!existingObjects || !existingObjects.rows) {
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Collect plant channel names that exist in objects but not in config
|
|
169
|
+
const toDelete = new Set();
|
|
170
|
+
for (const row of existingObjects.rows) {
|
|
171
|
+
const id = row.id; // e.g. flowers.0.plants.ficus.humidity
|
|
172
|
+
const relative = id.slice(`${this.namespace}.`.length); // plants.ficus.humidity
|
|
173
|
+
const parts = relative.split(".");
|
|
174
|
+
if (parts.length >= 2) {
|
|
175
|
+
const plantSafeName = parts[1];
|
|
176
|
+
if (!configuredNames.has(plantSafeName)) {
|
|
177
|
+
toDelete.add(plantSafeName);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// Delete states, channel and device objects for each removed plant
|
|
183
|
+
for (const safeName of toDelete) {
|
|
184
|
+
this.log.info(
|
|
185
|
+
`flowers: removing objects for deleted plant "${safeName}"`,
|
|
186
|
+
);
|
|
187
|
+
// Delete all states under plants.<safeName>
|
|
188
|
+
for (const sensor of ["humidity", "temperature", "battery"]) {
|
|
189
|
+
try {
|
|
190
|
+
await this.delObjectAsync(`plants.${safeName}.${sensor}`);
|
|
191
|
+
} catch {
|
|
192
|
+
// ignore if not exists
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// Delete device object plants.<safeName>
|
|
196
|
+
try {
|
|
197
|
+
await this.delObjectAsync(`plants.${safeName}`);
|
|
198
|
+
} catch {
|
|
199
|
+
// ignore if not exists
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// If no plants remain, also remove the plants channel
|
|
204
|
+
if (configuredNames.size === 0) {
|
|
205
|
+
try {
|
|
206
|
+
await this.delObjectAsync("plants");
|
|
207
|
+
} catch {
|
|
208
|
+
// ignore
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
} catch (err) {
|
|
212
|
+
this.log.warn(`flowers: cleanup error: ${err.message}`);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
140
216
|
// ── Report scheduling ──────────────────────────────────────────────────
|
|
141
217
|
|
|
142
218
|
_scheduleDailyReport() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.flowers",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.8",
|
|
4
4
|
"description": "ioBroker adapter for monitoring indoor plants via soil moisture, temperature and battery sensors with Telegram notifications",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "sadam6752-tech",
|
|
@@ -34,8 +34,7 @@
|
|
|
34
34
|
"@iobroker/adapter-dev": "^1.5.0",
|
|
35
35
|
"@iobroker/dev-server": "^0.8.0",
|
|
36
36
|
"@iobroker/eslint-config": "^2.2.0",
|
|
37
|
-
"@iobroker/testing": "^5.2.2"
|
|
38
|
-
"eslint": "^9.17.0"
|
|
37
|
+
"@iobroker/testing": "^5.2.2"
|
|
39
38
|
},
|
|
40
39
|
"main": "main.js",
|
|
41
40
|
"files": [
|