This commit is contained in:
Koen Kanters
2022-12-12 21:35:10 +01:00
parent 54d8002fd3
commit 4d32326a4f
4 changed files with 11 additions and 4 deletions
+5 -3
View File
@@ -64,9 +64,11 @@ export default class Configure extends Extension {
}
override async start(): Promise<void> {
for (const device of this.zigbee.devices(false)) {
await this.configure(device, 'started');
}
setImmediate(async () => {
for (const device of this.zigbee.devices(false)) {
await this.configure(device, 'started');
}
});
this.eventBus.onDeviceJoined(this, (data) => {
if (data.device.zh.meta.hasOwnProperty('configured')) {
+3 -1
View File
@@ -65,6 +65,7 @@ describe('Configure', () => {
jest.useFakeTimers();
controller = new Controller(jest.fn(), jest.fn());
await controller.start();
await jest.runOnlyPendingTimers();
await flushPromises();
});
@@ -72,8 +73,9 @@ describe('Configure', () => {
data.writeDefaultConfiguration();
settings.reRead();
mocksClear.forEach((m) => m.mockClear());
coordinatorEndpoint = zigbeeHerdsman.devices.coordinator.getEndpoint(1);
coordinatorEndpoint = zigbeeHerdsman.devices.coordinator.getEndpoint(1);
await resetExtension();
await jest.runOnlyPendingTimers();
});
afterAll(async () => {
+1
View File
@@ -36,6 +36,7 @@ describe('OTA update', () => {
jest.useFakeTimers();
controller = new Controller(jest.fn(), jest.fn());
await controller.start();
await jest.runOnlyPendingTimers();
await flushPromises();
});
+2
View File
@@ -16,6 +16,8 @@ describe('Receive', () => {
jest.useFakeTimers();
controller = new Controller(jest.fn(), jest.fn());
await controller.start();
await jest.runOnlyPendingTimers();
await flushPromises();
});
beforeEach(async () => {