Commit Graph
6 Commits
Author SHA1 Message Date
mokusoneandClaude Opus 4.7 a4932a1a8c fix(admin): remove invalid 'multiline' property from excludePatterns
The JSON Config schema for type 'text' enforces additionalProperties:false
and 'multiline' is not a documented property. Its presence caused the
admin UI to fail schema validation and refuse to render the panel.

Multi-line behaviour is already provided by 'minRows: 6' alone — the
schema explicitly states: "Set this attribute to 2 or more if you want
to have a textarea with more than one row."

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-14 22:12:51 +02:00
mokusone 7b5679a753 docs: document entity exclude filter and add changelog entry
Adds a new README section explaining the glob syntax, providing examples and
covering the verbose-logging toggle. Also adds a WORK IN PROGRESS changelog
entry for the next release.
2026-05-14 11:40:28 +02:00
mokusone fc7efd4768 feat(filter): add verbose filter logging option
New `verboseFilterLog` boolean (default `false`). When enabled, the initial
sync logs every excluded entity_id individually on INFO level. This is
useful when iterating on exclude patterns or verifying that the filter
catches the intended entities.

The verbose output is intentionally limited to the first sync. Subsequent
debouncedSync() calls only emit the aggregate count to avoid log spam
during normal operation. Live `state_changed` events for filtered entities
remain on DEBUG.

Admin UI gets a checkbox below the patterns field; i18n keys added for
all 11 supported languages.
2026-05-14 11:40:28 +02:00
mokusone 288273005a feat(admin): add exclude patterns UI field with i18n
JSON-Config field `excludePatterns` (multiline textarea, 6 rows by default,
full width). Help text explains the syntax: glob with `*`, `#` for comments,
empty = filter inactive.

i18n translations added for all 11 supported languages so the label and
help text are localised consistently with the rest of the admin UI.
2026-05-14 11:40:28 +02:00
mokusone 6889664c28 feat(filter): integrate exclude filter into parseStates and state_changed
Adapter now consults the exclude-pattern list (new `native.excludePatterns`
config option, multi-line string) at two points:

- `parseStates()` skips matching entities entirely. They are not registered
  as ioBroker objects and no state is written. A summary INFO line reports
  the count when the filter dropped anything from a sync.
- The `state_changed` event handler short-circuits matching live updates
  with a DEBUG line, so a filtered entity that still emits state changes
  in HA does not cause any churn in ioBroker.

Patterns are parsed once at adapter start: trimmed, empty lines and lines
starting with `#` are dropped. An empty resulting list means the filter is
inactive — adapter behaviour is then identical to the previous version.

Default config ships with example comments only, so existing installations
see no functional change after the update.
2026-05-14 11:40:28 +02:00
mokusone 9b95ece284 feat(filter): add isExcluded helper with unit tests
Glob-based entity_id matcher used by the upcoming exclude-filter feature.
Single wildcard `*` (matches any sequence including dots), all other characters
matched literally with regex metacharacters escaped. Case-sensitive, anchored.

Empty pattern array always returns false, so the helper is a no-op when the
adapter is not configured to filter anything.

New mocha unit-test suite invoked via `npm run test:unit` (separate from the
existing js-controller-backed test:integration).
2026-05-14 11:40:28 +02:00