BatteryManager

지원이 중단되었습니다: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.

BatteryManager 인터페이스는 시스템의 배터리 충전 상태에 대한 정보를 확인 하는 방법을 제공합니다.

navigator.battery 프로퍼티는 Battery Status API와 상호작용 할 수 있는 BatteryManager 인터페이스의 인스턴스를 반환합니다.

속성

BatteryManager.charging 읽기 전용

배터리가 현재 충전 중인지 여부를 Boolean 값으로 나타냅니다.

BatteryManager.chargingTime 읽기 전용

배터리가 완전히 충전되기 까지 남은 시간을 초로 표현합니다. 0 이면 이미 배터리의 충전이 완료 된 상황 입니다.

BatteryManager.dischargingTime 읽기 전용

배터리가 완전히 방전되고 시스템이 중지 될 때까지의 남은 시간을 초로 표현 합니다.

BatteryManager.level (en-US) 읽기 전용

배터리의 충전 상태를 0.0 에서 1.0 사이의 값으로 표현 합니다.

이벤트

chargingchange (en-US)

charging 이벤트의 핸들러 입니다. 이 이벤트는 배터리 충전 상태가 변경될 때 발생합니다.

chargingtimechange (en-US)

chargingTime 이벤트의 핸들러 입니다. 이 이벤트는 배터리 충전 시간이 변경될 때 발생합니다.

dischargingtimechange (en-US)

dischargingTime 이벤트의 핸들러 입니다. 이 이벤트는 배터리 방전 시간이 변경될 때 발생합니다.

levelchange (en-US)

level (en-US) 이벤트의 핸들러 입니다. 이 이벤트는 배터리 수준 상태가 변경 될 때 발생합니다.

메서드

EventTarget 으로 부터 상속을 받습니다.

명세

Specification
Battery Status API
# the-batterymanager-interface

브라우저 호환성

BCD tables only load in the browser

참고