Skip to content

Commit f3d4880

Browse files
committed
Update device_states.py
1 parent fd318bc commit f3d4880

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/device_states.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ def battery_state_update(device: object, format: str = "Celcius"):
1717
if ":" in line:
1818
key, value = line.split(":", 1)
1919
battery_info[key.strip()] = value.strip()
20+
21+
22+
# Taking Battery Health/Status and Turning into "result"""
23+
if "vendor.samsung.hardware" in battery_states['health']:
24+
extract_health= (battery_states['health'].split("::")[0].replace("vendor.samsung.hardware.health@",""))
25+
battery_states['health'] = str(round(float(extract_health)))
2026

2127
battery_info['status'] = bat_state_conver(choice='status',num=int(battery_info['status']))
2228
return battery_info

0 commit comments

Comments
 (0)