Add DailySleepData with sleep need from coach#171
Conversation
Adds a new endpoint for detailed sleep data including: - Sleep need recommendations from Garmin coach - Next day's sleep need - Body battery change - Resting heart rate - Skin temperature deviations Closes #170 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
WalkthroughThis PR introduces a new data layer module for daily sleep data including sleep need information. It adds the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (2)
📒 Files selected for processing (5)
🧰 Additional context used📓 Path-based instructions (4)**/*.md📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
tests/**/*.py📄 CodeRabbit inference engine (CLAUDE.md)
Files:
tests/**⚙️ CodeRabbit configuration file
Files:
🧬 Code graph analysis (3)src/garth/data/__init__.py (1)
tests/data/test_daily_sleep_data.py (3)
src/garth/data/daily_sleep_data.py (3)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (10)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #171 +/- ##
==========================================
Coverage 100.00% 100.00%
==========================================
Files 62 64 +2
Lines 2807 2970 +163
==========================================
+ Hits 2807 2970 +163
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Remove redundant `if not data` check (API always returns dict) - Simplify daily_sleep_dto check (dict always has daily_sleep_dto key) - Convert properties to single-line ternary expressions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Summary
DailySleepDataclass for detailed sleep data with sleep need recommendations/sleep-service/sleep/dailySleepData?date={date}endpointCloses #170
Test plan
get()andlist()methods🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Documentation
Tests
✏️ Tip: You can customize this high-level summary in your review settings.