Skip to content

Commit

Permalink
Update 0001_battery_voltage.js
Browse files Browse the repository at this point in the history
Bug fix: values > 3.0V not reported correctly.  Bloody brackets...
  • Loading branch information
ebaauw committed Oct 14, 2024
1 parent ef6ca9f commit 43c0aaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion devices/fireangel/0001_battery_voltage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/* global Attr, Item */
// Map battery voltage from 1.9V ... 3.0V to 0% ... 100%
Item.val = Math.max(0, Math.min(Math.round(9.09090909 * (Attr.val - 19), 100)))
Item.val = Math.max(0, Math.min(Math.round(9.09090909 * (Attr.val - 19)), 100))

0 comments on commit 43c0aaa

Please sign in to comment.