fixed type of pdu temperature

This commit is contained in:
Jakob Meier 2022-06-10 11:25:27 +02:00
parent 2a245b1714
commit c9d35df277

View File

@ -202,14 +202,14 @@ def handle_pdu_data(
f"{voltage_list[idx]:05} | {current_list[idx]:04}"
)
pw.dlog(content_line)
fmt_str = "!IBh"
fmt_str = "!IBf"
inc_len = struct.calcsize(fmt_str)
(boot_count, batt_mode, temperature) = struct.unpack(
fmt_str, hk_data[current_idx: current_idx + inc_len]
)
info = (
f"Boot Count {boot_count} | Battery Mode {batt_mode} | "
f"Temperature {temperature / 10.0}"
f"Temperature {temperature}"
)
pw.dlog(info)