mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-10-22 22:11:22 +00:00
Publish and respond to bridge/config/devices/get (#1329)
* - When sent a empty payload to bridge/config/devices/get , publish to 'bridge/config/devices' - For bridge/config/devices & bridge/config/devices/get only ever publish to the corresponding topic if a empty payload is sent. - Make sure devicesPublish doesn't treat messages to bridge/config/devices/get as a zigbee device. * fix eslinting errors * Update bridgeConfig.js
This commit is contained in:
1 parent
2328ecb2ee
commit
25408769e6
3 files changed
+32
-4
No files matched your search
@@ -657,6 +657,27 @@ describe('DevicePublish', () => {
|
||||
expect(parsed.postfix).toBe('');
|
||||
});
|
||||
|
||||
|
||||
it('Should not respond to bridge/config/devices/get', () => {
|
||||
const topic = 'zigbee2mqtt/bridge/config/devices/get';
|
||||
const parsed = devicePublish.parseTopic(topic);
|
||||
expect(parsed).toBeNull();
|
||||
});
|
||||
|
||||
it('Should not respond to bridge/config/devices/set', () => {
|
||||
const topic = 'zigbee2mqtt/bridge/config/devices/set';
|
||||
const parsed = devicePublish.parseTopic(topic);
|
||||
expect(parsed).toBeNull();
|
||||
});
|
||||
|
||||
|
||||
it('Should not respond to bridge/config/devices', () => {
|
||||
const topic = 'zigbee2mqtt/bridge/config/devices';
|
||||
const parsed = devicePublish.parseTopic(topic);
|
||||
expect(parsed).toBeNull();
|
||||
});
|
||||
|
||||
|
||||
it('Should parse topic with when base topic has multiple slashes', () => {
|
||||
jest.spyOn(settings, 'get').mockReturnValue({
|
||||
mqtt: {
|
||||
|
||||
Reference in new issue
Block a user