Skip to content

Commit

Permalink
Fix batteryLevel to check secondary battery (#1422)
Browse files Browse the repository at this point in the history
  • Loading branch information
stanaka authored Jul 16, 2024
1 parent 9400513 commit 4a6cc59
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/ring-client-api/ring-camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ export function getBatteryLevel(

if (
!levels.length ||
(health && !health.battery_percentage && !health.battery_present)
(health &&
!health.battery_percentage &&
!health.battery_present &&
!health.second_battery_percentage)
) {
return null
}
Expand Down
1 change: 1 addition & 0 deletions packages/ring-client-api/ring-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ export interface BaseCameraData {
rssi_category: 'good' | string
battery_voltage_category: 'very_good' | string
second_battery_voltage_category: 'unknown' | string
second_battery_percentage?: number // 0 - 100
second_battery_percentage_category: 'unknown' | string
battery_save: boolean
firmware_version_status: 'Up to Date'
Expand Down

0 comments on commit 4a6cc59

Please sign in to comment.