Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError when using the .battery() method #135

Open
arnold-layne opened this issue Jun 14, 2024 · 0 comments
Open

ValueError when using the .battery() method #135

arnold-layne opened this issue Jun 14, 2024 · 0 comments

Comments

@arnold-layne
Copy link

arnold-layne commented Jun 14, 2024

I'm getting a ValueError when trying to use the .battery() method on a AdbDevice class instance even tho it works perfectly fine through pure adb, here's the replication:

from adbutils import adb
d = adb.device()
AdbDevice(serial=RXCT303****) # Last 4 digits censored
d.battery()
Traceback (most recent call last):
File "", line 1, in
File "C:\Python312\Lib\site-packages\adbutils\shell.py", line 522, in battery
key, val = line.strip().split(':', 1)
^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)

The output I get when using pure adb through the shell command 'adb shell dumpsys battery':

Current Battery Service state:
AC powered: false
USB powered: true
Wireless powered: false
Max charging current: 0
Max charging voltage: 0
Charge counter: 2809520
status: 2
health: 2
present: true
level: 69
scale: 100
voltage: 4061
temperature: 313
technology: Li-ion
batteryMiscEvent: 65536
batteryCurrentEvent: 32768
mSecPlugTypeSummary: 2
LED Charging: true
LED Low Battery: true
current now: 532
charge counter: 2809520
Adaptive Fast Charging Settings: false
Super Fast Charging Settings: true
USE_FAKE_BATTERY: false
FEATURE_WIRELESS_FAST_CHARGER_CONTROL: true
mWasUsedWirelessFastChargerPreviously: false
mWirelessFastChargingSettingsEnable: true
LLB CAL: 20220323
LLB MAN:
LLB CURRENT: YEAR2024M6D11
LLB DIFF: 115
SEC_FEATURE_BATTERY_FULL_CAPACITY: true
mFullCapacityEnable: false
FEATURE_HICCUP_CONTROL: true
FEATURE_SUPPORTED_DAILY_BOARD: false
SEC_FEATURE_BATTERY_LIFE_EXTENDER: false
SEC_FEATURE_USE_WIRELESS_POWER_SHARING: true
health: [email protected]::ISehHealth@Proxy
BatteryInfoBackUp
mSavedBatteryAsoc: 94
mSavedBatteryMaxTemp: 486
mSavedBatteryMaxCurrent: 5258
mSavedBatteryUsage: 55334
FEATURE_SAVE_BATTERY_CYCLE: true
SEC_FEATURE_PREVENT_SWELLING: false

@arnold-layne arnold-layne changed the title ValueError when using the method battery ValueError when using the .battery() method Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant