Skip to content

Commit

Permalink
correct await / async definiction
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanfmartinez committed Sep 29, 2024
1 parent 8cf4bd2 commit b6ac7ac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/extension/receive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default class Receive extends Extension {
this.debouncers[device.ieeeAddr].publish();
}

publishThrottle(device: Device, payload: KeyValue, time: number): void {
async publishThrottle(device: Device, payload: KeyValue, time: number): Promise<void> {
if (!this.throttlers[device.ieeeAddr]) {
this.throttlers[device.ieeeAddr] = {
publish: throttle(this.publishEntityState, time * 1000),
Expand Down Expand Up @@ -151,7 +151,7 @@ export default class Receive extends Extension {
this.publishDebounce(data.device, payload, data.device.options.debounce, data.device.options.debounce_ignore);
} else if (data.device.options.throttle || (data.device.options.description && data.device.options.description.includes('SPAMMER'))) {
const throttleTime = data.device.options.throttle || 30;
this.publishThrottle(data.device, payload, throttleTime);
await this.publishThrottle(data.device, payload, throttleTime);
} else {
await this.publishEntityState(data.device, payload);
}
Expand Down

0 comments on commit b6ac7ac

Please sign in to comment.