mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2024-11-16 18:39:09 -07:00
Fix devices being undiscovered from Home Assistant when a non-standard Home Assistant discovery topic is used. #4480
This commit is contained in:
parent
4bb3ddcff2
commit
0beea18adb
@ -5,7 +5,6 @@ const zigbee2mqttVersion = require('../../package.json').version;
|
||||
const Extension = require('./extension');
|
||||
const objectAssignDeep = require(`object-assign-deep`);
|
||||
const stringify = require('json-stable-stringify-without-jsonify');
|
||||
const discoveryRegex = new RegExp(`homeassistant/(.*)/(.*)/(.*)/config`);
|
||||
|
||||
const cfg = {
|
||||
// Binary sensor
|
||||
@ -2425,6 +2424,7 @@ class HomeAssistant extends Extension {
|
||||
}
|
||||
|
||||
onMQTTMessage(topic, message) {
|
||||
const discoveryRegex = new RegExp(`${this.discoveryTopic}/(.*)/(.*)/(.*)/config`);
|
||||
const discoveryMatch = topic.match(discoveryRegex);
|
||||
const isDeviceAutomation = discoveryMatch && discoveryMatch[1] === 'device_automation';
|
||||
if (discoveryMatch) {
|
||||
|
Loading…
Reference in New Issue
Block a user