recorder: use target_power from TrainerSample, add json dump to logging#98
Merged
recorder: use target_power from TrainerSample, add json dump to logging#98
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the recorder to consume newer bleaksport trainer sample fields (notably target_power and speed_kmh) and enhances logging by binding full sample objects into Loguru records and pretty-printing them as JSON in the console formatter.
Changes:
- Bump
bleaksportgit revision inuv.lock. - Add structured TRACE logging for
RunningSample/TrainerSamplevialogger.bind(data=sample). - Update trainer sample handling to convert
speed_kmh → m/sand schedule ERG updates based onTrainerSample.target_power.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
uv.lock |
Updates bleaksport git commit to pick up new/changed trainer sample fields/APIs. |
src/fitness_tracker/recorder.py |
Uses TrainerSample.target_power to trigger ERG updates; switches to speed_kmh conversion; binds samples into TRACE logs. |
src/fitness_tracker/main.py |
Introduces a custom Loguru formatter that JSON-dumps bound extra["data"] for easier debugging. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/fitness_tracker/main.py
Outdated
| from dataclasses import asdict, is_dataclass | ||
| from enum import Enum | ||
|
|
||
| from bleaksport.trainer import TrainerSample |
There was a problem hiding this comment.
TrainerSample is imported but not used in this module. If it’s not intentionally kept for side effects or type checking, remove it to avoid dead imports.
Suggested change
| from bleaksport.trainer import TrainerSample |
Signed-off-by: Luis Garcia <git@luigi311.com>
edf14bf to
7dfc5e1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.