Module: Appium::Core::Android::Uiautomator2::Device

Extended by:
Forwardable
Defined in:
lib/appium_lib_core/android/uiautomator2/device.rb,
lib/appium_lib_core/android/uiautomator2/device/battery.rb

Defined Under Namespace

Modules: Battery

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.extended(_mod) ⇒ Object



45
46
47
# File 'lib/appium_lib_core/android/uiautomator2/device.rb', line 45

def extended(_mod)
  Battery.add_methods
end

Instance Method Details

#battery_infoHash

Get battery information.

Examples:


@driver.battery_info #=> { state: :charging, level: 0.7 }

Returns:

  • (Hash)

    Return battery level and battery state. Battery level in range [0.0, 1.0], where 1.0 means 100% charge. -1 is returned if the actual value cannot be retrieved from the system. Battery state. The following symbols are possible :unknown, :charging, :discharging, :not_charging, :full

Since:

  • Appium 1.6.0



# File 'lib/appium_lib_core/android/uiautomator2/device.rb', line 24