Git Product home page Git Product logo

Comments (4)

Gby56 avatar Gby56 commented on September 28, 2024 1

Thanks you SO MUCH for all the explanation, I finally figured out fitbit-weather and just popped it in and it worked right up :)

I just finished a simple clockface, by recycling FibitArcs, that's why I forked it, I'll push my code once I finish testing out the battery life and usability.

I'm using the Versa, and yes, the location might take a little while to show up, so the first minute or so Darksky isn't working for example. I'm thinking of reusing the Statemanager from FitbitArcs and implement stocks, and other APIs for versatility.

I also added an automatic switch between the different values (steps, cal, HR, weather), to keep the UI minimal and cleaner.

from feels-fitbit.

rootasjey avatar rootasjey commented on September 28, 2024

You're right.
I started this project but haven't get it work yet, sorry.

You should see my other project metrix-fitbit where I fetch and show weather's data from DarkSky.
You can deploy the clock face and see it working.

To fetch weather data, the straightforward way is to use fitbit-weather and to follow its documentation (readme.md). It already setup the necessary endpoints but you could do it manually.

Should it be fetched by the Versa/Ionic, or by the companion ?

Versa/Ionic cannot fetch directly data.
To fetch data through Web APIs, you need a companion. The companion is run on the mobile device. When the companion got the data, it has to pass it to the watch through the messaging API.

Ionic/Versa Companion (mobile)
Ask for fetch through Messaging API Fetch data and respond to Ionic/Versa through Messaging API
On device example On mobile example with fitbit-weather

Should it be fetched regularly and cached or fetched only when asked to display ? (Caching the previous while waiting for fetch then update the UI)

It's up to you.
The fitbit-weather module can use caching if you specify a maxium age parameter.
In my clock face I use a combination of an hour caching data + trying to fetch new data only when asked to display. But it can be edited in the clock face's settings.
Caching is useful to avoid calling too many times DarkSky's API as it's free only for the first 1k requests.

[...] if the Versa calls it, I supposed the phone would fetch then send through websocket the result, but I'm not sure about it.

Yes, this is exactly the process. Same goes for the Ionic.

Do you have a Versa ?
Because I got some users which have trouble with displaying the weather's data and I think it's because the Versa has no built-in GPS (these users also had iOS devices so it may be permissions' issues).
The Versa has to use the mobile's GPS where as the Ionic can use its own built-in.
So I've allowed users to manually configure their location.

Let me know if you have more questions.
I struggled with this too when I first implemented fetch data.

PS: I like & used your clock face :)

from feels-fitbit.

rootasjey avatar rootasjey commented on September 28, 2024

Great !
I'll follow this. I'm always happy to see new clock faces.

from feels-fitbit.

Gby56 avatar Gby56 commented on September 28, 2024

There you go ! https://github.com/Gby56/LifeCircle
See you around 👋 :)

from feels-fitbit.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.