mirror of
https://github.com/arendst/Tasmota.git
synced 2025-08-01 23:17:43 +00:00
permit battery already expressed in percent (#23738)
* permit battery already expressed in percent * commit fixed * cosmetic fix
This commit is contained in:
parent
9b01d28381
commit
4e92f66f88
@ -98,6 +98,13 @@ class lwdecode_cls
|
||||
batt_percent /= 7 # 1..14px showing battery load
|
||||
msg += format("<td><i class=\"bt\" title=\"%.3fV (%s)\" style=\"--bl:%dpx;color:%s\"></i></td>",
|
||||
battery, self.dhm(battery_last_seen), batt_percent, color_text)
|
||||
elif battery >= 100000 && battery <= 100100 # battery already expressed in %
|
||||
var pbatt = battery - 100000
|
||||
var batt_percent = pbatt
|
||||
if batt_percent > 98 batt_percent = 98 end # 98% / 14px = 7
|
||||
batt_percent /= 7 # 1..14px showing battery load
|
||||
msg += format("<td><i class=\"bt\" title=\"%d%% (%s)\" style=\"--bl:%dpx;color:%s\"></i></td>",
|
||||
pbatt, self.dhm(battery_last_seen), batt_percent, color_text)
|
||||
else
|
||||
msg += "<td> </td>"
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user