DrieStone / TeslaData-Widget

A Scriptable widget to pull data from the TeslaFi API
59 stars 18 forks source link

Miles ? #2

Closed danitalia1 closed 3 years ago

danitalia1 commented 3 years ago

96862174-C502-4390-BB11-FF5E643A6C76 Hey :)!

Great widget !! Would it be possible to maybe also to offer the widget, to maybe display KM instead Miles ?

My car displays only miles even if there is KM written, would that be possible ?

Thanky ou so much!

screamer3003 commented 3 years ago

You can add the factor * 1.609 in the script and you have the range in km. It will look so

if (show_range_est) { batteryCurrentCharge = Math.floor(items.est_battery_range * 1.609)+units

danitalia1 commented 3 years ago

Great! That worked fine !! Just perfect!

DrieStone commented 3 years ago

I didn't test this earlier, and I assumed the value returned by the API would match the label. I've rolled this change into the code as well, so future users shouldn't have this problem.