Skip to content

Commit

Permalink
[606] feat: robust settings for custom Device Info (#620)
Browse files Browse the repository at this point in the history
* robust support for custom device info - wip

* finish up base GUI features

* some fixes

* update relase notes and example files

* unit tests

* documentation updates

* fix

* update release notes

* try fix release workflow
  • Loading branch information
philosowaffle authored Feb 4, 2024
1 parent f7e7516 commit 5edc23a
Show file tree
Hide file tree
Showing 50 changed files with 1,543 additions and 1,121 deletions.
6 changes: 3 additions & 3 deletions .github/actions/publish-ui-dist/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ inputs:
description: 'The OS we are running on'
required: true
outputs:
artifact:
description: 'Path to the published artifact'
value: ${{ github.workspace }}/src/ClientUI/bin/Release/${{ inputs.framework }}/${{ inputs.os }}
artifact_name:
description: 'Name of the uploaded artifact'
value: ui_${{ inputs.os }}_${{ env.BUILD_VERSION }}
runs:
using: "composite"
steps:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
name: Publish UI Distribution
runs-on: 'windows-latest'
outputs:
artifact: ${{ steps.win-ui-create-artifact.outputs.artifact }}
artifact_name: ${{ steps.win-ui-create-artifact.outputs.artifact_name }}
strategy:
matrix:
dotnet: [ '7.0.400' ]
Expand All @@ -71,10 +71,14 @@ jobs:
runs-on: ubuntu-latest
needs: [publish-ui-dist, publish-docker-images]
steps:
- uses: actions/download-artifact@v3
with:
name: ${{ needs.publish-ui-dist.outputs.artifact_name }}
path: /download
- name: Create Zip for Win UI Release Artifact
uses: papeloto/action-zip@v1
with:
files: ${{ needs.publish-ui-dist.outputs.artifact }}
files: /download/${{ needs.publish-ui-dist.outputs.artifact_name }}
dest: /dist/ui_win_${{ github.event.inputs.version }}.zip

- uses: actions/checkout@v4
Expand Down
11 changes: 1 addition & 10 deletions .github/workflows/sync_peloton_to_garmin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,6 @@ jobs:
- name: Set env
run: echo "OUTPUT_DIR=/app/output" >> $GITHUB_ENV
- run: mkdir -p ${{ env.OUTPUT_DIR }}
- name: Create device info file
env:
DEVICE_INFO: ${{ secrets.DEVICE_INFO }}
if: ${{ env.DEVICE_INFO }}
run: |
cat <<EOT > /app/deviceInfo.xml
${{secrets.DEVICE_INFO}}
EOT
- name: Create config file
env:
DEFAULT_WORKOUT_NUM: 5
Expand All @@ -48,8 +40,7 @@ jobs:
"Tcx": false,
"SaveLocalCopy": ${{ github.event.inputs.saveLocalCopy || false }},
"IncludeTimeInHRZones": false,
"IncludeTimeInPowerZones": false,
"DeviceInfoPath": "./deviceInfo.xml"
"IncludeTimeInPowerZones": false
},
"Peloton": {
"NumWorkoutsToDownload": ${{ github.event.inputs.workoutsToDownload || env.DEFAULT_WORKOUT_NUM }},
Expand Down
3 changes: 1 addition & 2 deletions configuration.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"Tcx": false,
"SaveLocalCopy": true,
"IncludeTimeInHRZones": false,
"IncludeTimeInPowerZones": false,
"DeviceInfoPath": "./deviceInfo.xml"
"IncludeTimeInPowerZones": false
},

"Peloton": {
Expand Down
11 changes: 0 additions & 11 deletions deviceInfo.sample.xml

This file was deleted.

34 changes: 34 additions & 0 deletions mkdocs/docs/configuration/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# API File Configuration

!!! tip

These settings only apply if you are running an Instance of the API. P2G provides some [recommended config files](https://github.com/philosowaffle/peloton-to-garmin/tree/master/docker/webui) to get you started.

Some lower level configuration cannot be provided via the web user interface and can only be provided by config file.

The Api looks for a file named `configuration.local.json` in the same directory where it is run. Below is an example of the structure of this config file.

```json
{
"Api": { /** (1)! **/ },
"Observability": { /** (2)! **/ }
}
```

1. Jump to [Api Config Documentation](#api-config)
2. Go to [Observability Config Documentation](observability.md#observability-config)

## Api Config

!!! warning
Most people should not need to change this setting.

```json
"Api": {
"HostUrl": "http://*:8080"
}
```

| Field | Required | Default | UI Setting Location | Description |
|:-----------|:---------|:--------|:--------------------|:------------|
| HostUrl | no | `http://localhost:8080` | none | The host and port the WebUI should bind to and listen on. |
30 changes: 30 additions & 0 deletions mkdocs/docs/configuration/app.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# App Settings

The App Settings provide global settings for the P2G application.

## Settings location

| Run Method | Location |
|------------|----------|
| Web UI | UI > Settings > App Tab |
| Windows Exe | UI > Settings > App Tab |
| GitHubAction | Config Section in Workflow |
| Headless (Docker or Console) | Config section in `configuration.local.json` |

## File Configuration

```json
"App": {
"EnablePolling": true,
"PollingIntervalSeconds": 86400,
"CheckForUpdates": true
}
```

## Settings Overview

| Field | Required | Default | Description |
|:-----------|:---------|:--------|:------------|
| EnablePolling | no | `true` | `true` if you wish P2G to run continuously and poll Peloton for new workouts. |
| PollingIntervalSeconds | no | 86400 | The polling interval in seconds determines how frequently P2G should check for new workouts. Be warned, that setting this to a frequency of hourly or less may get you flagged by Peloton as a bad actor and they may reset your password. The default is set to Daily. |
| CheckForUpdates | no | `true` | `true` if P2G should check for updates and write a log message if a new release is available. If using the UI this message will display there as well. |
4 changes: 0 additions & 4 deletions mkdocs/docs/configuration/command-line.md

This file was deleted.

36 changes: 0 additions & 36 deletions mkdocs/docs/configuration/environment-variables.md

This file was deleted.

17 changes: 17 additions & 0 deletions mkdocs/docs/configuration/exercise-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Exercise Types

```json
Cycling
Outdoor Cycling
BikeBootcamp
TreadmillRunning
OutdoorRunning
TreadmillWalking
OutdoorWalking
Cardio
Circuit
Strength
Stretching
Yoga
Meditation
```
Loading

0 comments on commit 5edc23a

Please sign in to comment.