mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-08-28 13:34:24 +00:00
Dummy options (#5981)
* Split groups and devices schema into definition * Dummy bridge/request/options * Linter
This commit is contained in:
@@ -34,6 +34,7 @@ class Bridge extends Extension {
|
||||
'touchlink/identify': this.touchlinkIdentify.bind(this),
|
||||
'touchlink/scan': this.touchlinkScan.bind(this),
|
||||
'health_check': this.healthCheck.bind(this),
|
||||
'options': this.bridgeOptions.bind(this),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -140,6 +141,10 @@ class Bridge extends Extension {
|
||||
return this.changeEntityOptions('group', message);
|
||||
}
|
||||
|
||||
async bridgeOptions(message) {
|
||||
return utils.getResponse(message, {}, 'Saving settings is not yet implemented');
|
||||
}
|
||||
|
||||
async deviceRemove(message) {
|
||||
return this.removeEntity('device', message);
|
||||
}
|
||||
|
||||
@@ -607,6 +607,17 @@ describe('Bridge', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('Should throw not implemented erron on bridge/request/options', async () => {
|
||||
MQTT.publish.mockClear();
|
||||
MQTT.events.message('zigbee2mqtt/bridge/request/options', stringify({}));
|
||||
await flushPromises();
|
||||
expect(MQTT.publish).toHaveBeenCalledWith(
|
||||
'zigbee2mqtt/bridge/response/options',
|
||||
stringify({"data":{},"status":"error","error":"Saving settings is not yet implemented"}),
|
||||
{retain: false, qos: 0}, expect.any(Function)
|
||||
);
|
||||
});
|
||||
|
||||
it('Should allow to add group by string', async () => {
|
||||
MQTT.publish.mockClear();
|
||||
MQTT.events.message('zigbee2mqtt/bridge/request/group/add', 'group_193');
|
||||
|
||||
Reference in New Issue
Block a user