From d87347923b2b919f9443a359101668258c07a7cb Mon Sep 17 00:00:00 2001 From: Ilya Kirov Date: Wed, 19 Jan 2022 21:45:15 +0300 Subject: [PATCH] Fix endpoint match (#10898) https://github.com/Koenkk/zigbee2mqtt/discussions/9504 For this case topic is 'state_top_left', 'state_bottom_left' and etc.., Old pattern it is match as: [state_top_left, state_top, left] New pattern it is match as: [state_top_left, state, top_left] --- lib/extension/publish.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/extension/publish.ts b/lib/extension/publish.ts index a9382418f..4a1b9dada 100644 --- a/lib/extension/publish.ts +++ b/lib/extension/publish.ts @@ -10,7 +10,7 @@ import Device from '../model/device'; import bind from 'bind-decorator'; const topicRegex = new RegExp(`^(.+?)(?:/(${utils.endpointNames.join('|')}|\\d+))?/(get|set)(?:/(.+))?`); -const propertyEndpointRegex = new RegExp(`^(.*)_(${utils.endpointNames.join('|')})$`); +const propertyEndpointRegex = new RegExp(`^([^_]*)_(${utils.endpointNames.join('|')})$`); const stateValues = ['on', 'off', 'toggle', 'open', 'close', 'stop', 'lock', 'unlock']; const sceneConverterKeys = ['scene_store', 'scene_add', 'scene_remove', 'scene_remove_all'];