feat(filter): add cleanupExcludedOnStart option to delete stale objects

When enabled, on each adapter start the adapter scans all existing
hass.0.entities.* channels and deletes those whose entity_id matches
any of the configured excludePatterns. This complements the existing
filter (which only prevents new objects from being created) by also
cleaning up objects that were synced before the filter was activated
or before the patterns were extended.

Safety:
- Channels (and any of their sub-states) holding common.custom config
  (history/influxdb/sql) are kept and a warning is logged so the user
  can decide manually.
- Existing deleteStaleObjects() 50% sanity-guard is intentionally NOT
  applied here — the user explicitly opted in to the cleanup.
- Per-id deletion only logs when verboseFilterLog is also active.

Default is false (opt-in). Adds new admin checkbox + i18n keys for all
11 languages (machine translations for non-en/de still pending).
This commit is contained in:
mokusone
2026-05-15 04:14:41 +02:00
parent a4932a1a8c
commit a40dc58e35
14 changed files with 158 additions and 27 deletions
+8 -6
View File
@@ -1,12 +1,14 @@
{
"Home assistant IP": "IP de l'assistant à domicile ",
"Home assistant WS Port": "Port WS de l'assistant domestique ",
"Password repeat": "Répéter le mot de passe ",
"Home assistant IP": "IP de l'assistant à domicile ",
"Home assistant WS Port": "Port WS de l'assistant domestique ",
"Password repeat": "Répéter le mot de passe ",
"Password": "Mot de passe",
"Passwords missmatch!": "Les mots de passe ne correspondent pas !",
"Passwords missmatch!": "Les mots de passe ne correspondent pas !",
"Secure": "HTTPS ?",
"Exclude patterns (one per line)": "Modèles d'exclusion (un par ligne)",
"Glob patterns, * wildcard. Lines starting with # are comments. Empty = filter off.": "Modèles glob, * comme joker. Les lignes commençant par # sont des commentaires. Vide = filtre désactivé.",
"Verbose filter logging": "Journalisation détaillée du filtre",
"When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).": "Lorsqu'activé, chaque entity_id exclu est journalisé individuellement pendant la synchronisation initiale de l'adaptateur (nécessite loglevel info ou debug)."
}
"When enabled, log each excluded entity_id individually during the initial adapter sync (requires loglevel info or debug).": "Lorsqu'activé, chaque entity_id exclu est journalisé individuellement pendant la synchronisation initiale de l'adaptateur (nécessite loglevel info ou debug).",
"Cleanup excluded entities on adapter start": "Cleanup excluded entities on adapter start",
"When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged.": "When enabled, on each adapter start delete existing objects under entities.* whose entity_id matches the exclude patterns. Objects with custom adapter config (history/influxdb/sql) are kept and logged."
}