Dummy options (#5981)

* Split groups and devices schema into definition

* Dummy bridge/request/options

* Linter
This commit is contained in:
John Doe
2021-01-30 15:44:36 +01:00
committed by GitHub
parent 61b9ddcd60
commit 0903f4c777
2 changed files with 16 additions and 0 deletions
+5
View File
@@ -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);
}
+11
View File
@@ -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');