Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion e3dc/_e3dc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,11 @@ def get_battery_data(
):
temperatures_data = rscpFindTagIndex(temperatures_raw, RscpTag.BAT_DATA)
sensorCount = rscpFindTagIndex(info, RscpTag.BAT_DCB_NR_SENSOR)
for sensor in range(0, sensorCount):

# As sensorCount can return bigger values than we have actual temperatures_data,
# we use the smaller count for robustness.
sensors = min(sensorCount, len(temperatures_data))
for sensor in range(0, sensors):
temperatures.append(temperatures_data[sensor][2])

# Set voltages, if available for the device
Expand Down