02-25-2018 06:10
02-25-2018 06:10
I want to Display batteryLevel on watchface.
I referred "https://dev.fitbit.com/build/reference/device-api/power/#".
But I can't it.
"undefined" on my Console.
Is there a way to do it?
Answered! Go to the Best Answer.
02-25-2018 12:01
02-25-2018 12:01
In order to use that you need to do the following:
import { battery } from "power"; myBatteryLabel.text = battery.chargeLevel;
I hope this helps 🙂
02-25-2018 12:01
02-25-2018 12:01
In order to use that you need to do the following:
import { battery } from "power"; myBatteryLabel.text = battery.chargeLevel;
I hope this helps 🙂
02-25-2018 14:28
02-25-2018 14:28
Have you put an appropriately named label in your svg? The example uses myBatteryLabel as a label id.
02-25-2018 17:19
02-25-2018 17:19
Sorry, I have very easy miss.
Variable name is "battery" to display batteryLevel.
So I changed this variable name, I'm successful!
Thank you so much!
02-25-2018 20:04 - edited 02-27-2018 22:55
02-25-2018 20:04 - edited 02-27-2018 22:55
Yes this as just an example of the relevant code. It's the same way you
would set the text of time.
02-25-2018 22:14 - edited 02-27-2018 22:56
02-25-2018 22:14 - edited 02-27-2018 22:56
So glad you found it 🙂 It's a pleasure! Always great to help each other
😄 This forum is great!