JanDeDobbeleer / oh-my-posh

The most customisable and low-latency cross platform/shell prompt renderer
https://ohmyposh.dev
MIT License
16.64k stars 2.33k forks source link

feat: Withings segment #2496

Closed GHRoss closed 2 years ago

GHRoss commented 2 years ago

Code of Conduct

What would you like to see changed/added?

Hey, so I have a Withings hybrid smart watch and I'd like my latest heart rate data or step count to appear in oh-my-posh, similar to the Nightscout segment.

The Withings API uses OAuth 2.0 for authentication, the same as Strava.

This lead me to thinking whether it would be a good idea to have a generic REST API segment, of sorts. Initially it might only support OAuth 2.0, but could be expanded to support Basic, API key or other types of authentication.

The general idea for this would be that you could simply say here are the things required to keep authentication alive (refresh token, etc), and here is the one value I want to be able to show within the segment itself.

It's probably not worth the headache, as it might result in lots of issues being raised where it doesn't work for X or Y API.

If this is a dumb idea, please close it off, it feels like a bit of a reach.

JanDeDobbeleer commented 2 years ago

@GHRoss we already have this for Strava AND it's generic so it can be extended. If you point me to the API, I'll gladly make it happen.

GHRoss commented 2 years ago

Oh wow, thank you!

https://developer.withings.com/

JanDeDobbeleer commented 2 years ago

The authentication is functional, now I can proceed to the segment itself.

GHRoss commented 2 years ago

Niiiice!

These are the values that I would say are most valuable to have in segments, if you're looking for some inspiration!

JanDeDobbeleer commented 2 years ago

I made some progress on the API, but I still need to make it functional. Somewhere next week I guess.

github-actions[bot] commented 7 months ago

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues. If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.