Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
fix: send right battery information on first tick
Browse files Browse the repository at this point in the history
  • Loading branch information
dhayab committed Jan 28, 2020
1 parent 680a6bb commit 4d62965
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ export class WithingsApi {
this.device = device;

const battery = device.deviceproperties.batterylvl;
(!this.battery || this.battery !== battery) && this.emit('battery', this.battery);
this.battery = device.deviceproperties.batterylvl;
(!this.battery || this.battery !== battery) && this.emit('battery', battery);
this.battery = battery;

const carbondioxide = await this.fetchMeasure(Measure.CarbonDioxide);
(!this.carbondioxide || this.carbondioxide.date !== carbondioxide.date) && this.emit('carbondioxide', carbondioxide.value);
Expand Down

0 comments on commit 4d62965

Please sign in to comment.