Skip to content

Commit 6181ab8

Browse files
committed
adjust wildcard
1 parent 80b3bcc commit 6181ab8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

main.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,14 @@ class Viessmannapi extends utils.Adapter {
358358
const featurePath = item.feature || '';
359359
return patterns.some(pattern => {
360360
if (pattern.endsWith('*')) {
361-
// Wildcard: heating.* matches heating.boiler, heating.burner, etc.
362-
const prefix = pattern.slice(0, -1);
363-
return featurePath.startsWith(prefix);
361+
// Wildcard: heating.* matches heating, heating.boiler, heating.burner, etc.
362+
let prefix = pattern.slice(0, -1);
363+
// Remove trailing dot to get base path
364+
if (prefix.endsWith('.')) {
365+
prefix = prefix.slice(0, -1);
366+
}
367+
// Match base path exactly OR as prefix with dot separator
368+
return featurePath === prefix || featurePath.startsWith(prefix + '.');
364369
}
365370
// Exact match
366371
return featurePath === pattern;

0 commit comments

Comments
 (0)