oh-my-posh/website/docs/segments/withings.mdx

79 lines
3 KiB
Plaintext
Raw Normal View History

2022-07-11 05:41:50 -07:00
---
id: withings
title: Withings
sidebar_label: Withings
---
import WithingsConnect from "/img/withings.svg";
2022-07-11 05:41:50 -07:00
## What
The [Withings][withings] health ecosystem of connected devices & apps is designed to improve daily wellbeing
and long-term health.
## Accessing your Withings data
To allow Oh My Posh access your Withings data you need to grant access to read your public activities.
This will give you an access and a refresh token. Paste the tokens into your Withings segment configuration.
Click the following link to connect with Withings:
2022-07-17 12:11:23 -07:00
<div className="withings">
<a href="https://account.withings.com/oauth2_user/authorize2?client_id=93675962e88ddfe53f83c0c900558f72174e0ac70ccfb57e48053530c7e6e494&response_type=code&redirect_uri=https://ohmyposh.dev/api/auth&scope=user.activity,user.metrics&state=withings">
<WithingsConnect className="withings" />
2022-07-17 12:11:23 -07:00
</a>
</div>
2022-07-11 05:41:50 -07:00
## Sample Configuration
2023-03-31 11:55:36 -07:00
import Config from '@site/src/components/Config.js';
<Config data={{
2022-07-11 05:41:50 -07:00
"type": "withings",
"style": "powerline",
"powerline_symbol": "\uE0B0",
"foreground": "#ffffff",
"background": "#000000",
2022-07-17 12:11:23 -07:00
"template": "{{ if gt .Weight 0.0 }} {{ round .Weight 2 }}kg {{ end }}",
2022-07-11 05:41:50 -07:00
"properties": {
"access_token": "11111111111111111",
"refresh_token": "1111111111111111",
2022-07-11 05:41:50 -07:00
"http_timeout": 1500
}
2023-03-31 11:55:36 -07:00
}}/>
2022-07-11 05:41:50 -07:00
## Properties
2024-04-04 13:29:19 -07:00
| Name | Type | Description |
| ---------------- | -------- | ----------------------------------------------------------------------------------------------------------------- |
| `access_token` | `string` | token from Withings login, see login link in section above. |
| `refresh_token` | `string` | token from Withings login, see login link in section above. |
| `expires_in` | `int` | the default timeout of the token from the Withings login |
| `http_timeout` | `int` | how long do you want to wait before you want to see your prompt more than your Withings data? - defaults to 500ms |
| `cache_timeout` | `int` | in minutes - How long do you want your Withings data cached? - defaults to 5 min |
2022-07-11 05:41:50 -07:00
## Template ([info][templates])
:::note default template
```template
2022-07-17 12:11:23 -07:00
{{ if gt .Weight 0.0 }} {{ round .Weight 2 }}kg {{ end }}
2022-07-11 05:41:50 -07:00
```
:::
### Properties
The properties below are available for use in your template
| Name | Type | Description |
| ------------- | -------- | ----------------------------------- |
| `.Weight` | `float` | your last measured weight |
| `.SleepHours` | `string` | your last measured sleep SleepHours |
| `.Steps` | `int` | your last measured steps |
2022-07-11 05:41:50 -07:00
Now, go out and be active!
[templates]: /docs/configuration/templates
2022-07-12 03:57:33 -07:00
[withings]: https://www.withings.com/