Skip to content

Commit

Permalink
Update NbAccessory.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ebaauw committed Jul 22, 2023
1 parent 693c954 commit ca127ef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/NbAccessory.js
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,9 @@ class SmartLock extends NbAccessory {
}
this.batteryService = new homebridgeLib.ServiceDelegate.Battery(this, {
batteryLevel: params.device.lastKnownState.batteryChargeState,
chargingState: params.device.lastKnownState.batteryCharging,
chargingState: params.device.lastKnownState.batteryCharging
? this.Characteristics.hap.ChargingState.CHARGING
: this.Characteristics.hap.ChargingState.NOT_CHARGING,
statusLowBattery: params.device.lastKnownState.batteryCritical
? this.Characteristics.hap.StatusLowBattery.BATTERY_LEVEL_LOW
: this.Characteristics.hap.StatusLowBattery.BATTERY_LEVEL_NORMAL
Expand Down

0 comments on commit ca127ef

Please sign in to comment.