Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Force await on read as now it returns empty promises
Browse files Browse the repository at this point in the history
  • Loading branch information
grigals committed Nov 22, 2023
1 parent 0433cf6 commit 7fe7a0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/devices/S7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ export class S7Connection extends DeviceConnection {
* @param {array} metrics Array of metric objects to read to
* @returns {array} Old metric values (for RbE checking)
*/
readMetrics(metrics: Metrics, payloadFormat?: string,) {
async readMetrics(metrics: Metrics, payloadFormat?: string,) {
const changedMetrics: sparkplugMetric[] = [];
// Tell S7 to update metric values
let newVals = this.#itemGroup.readAllItems(); // name: value
let newVals = await this.#itemGroup.readAllItems(); // name: value
this.emit('data', newVals, false);
}

Expand Down

0 comments on commit 7fe7a0f

Please sign in to comment.