Skip to content

Commit

Permalink
simplify client calls with single measurement values
Browse files Browse the repository at this point in the history
  • Loading branch information
lpgera committed Dec 20, 2023
1 parent 79744f2 commit aed6d28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
10 changes: 3 additions & 7 deletions packages/clients/hcsr501/hcsr501.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@ pin.watch(async (err, value) => {
return
}
log.debug('motion value:', value)
await client.storeMeasurements({
measurements: [
{
type: 'motion',
value: value,
},
],
await client.storeMeasurement({
type: 'motion',
value: value,
})
})
10 changes: 3 additions & 7 deletions packages/clients/senseair/senseair.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,9 @@ const onTick = async () => {
}

try {
await client.storeMeasurements({
measurements: [
{
type: 'co2',
value: latestMeasurement.value,
},
],
await client.storeMeasurement({
type: 'co2',
value: latestMeasurement.value,
})
} catch (error) {
log.error(error)
Expand Down

0 comments on commit aed6d28

Please sign in to comment.