Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity aggregation #70

Merged
merged 13 commits into from
Aug 18, 2024
Merged

Activity aggregation #70

merged 13 commits into from
Aug 18, 2024

Conversation

caarmen
Copy link
Owner

@caarmen caarmen commented Jul 20, 2024

  • Add fitbit_daily_activities DB view.
  • Stuff done:
    • Add tests that the new view returns expected data for given fitbit_activities data.
    • Add repo method to get the previous DailyActivityStats for a given user and activity type
    • Add a use case to take a DailyActivityStats, find the previous, all-time top, and recent top daily activity stats, and pass it to the new slack use case.
    • Add use case to post a DailyActivityStats object to slack.
    • Add a setting indicating which activity types should be posted to slack immediately.
    • Add a setting indicating which activity types should be posted to slack once a day.
    • If any activity types should be posted once a day, schedule a task for that.

⚠️ Settings breaking change

  • Removed setting:
    • FITBIT_ACTIVITY_TYPE_IDS
  • Added settings:
    • FITBIT_REALTIME_ACTIVITY_TYPE_IDS
    • FITBIT_DAILY_ACTIVITY_TYPE_IDS
    • FITBIT_DAILY_ACTIVITY_POST_TIME

Example of new settings:

FITBIT_REALTIME_ACTIVITY_TYPE_IDS=[55001, 90013]
FITBIT_DAILY_ACTIVITY_TYPE_IDS=[90019]
FITBIT_DAILY_ACTIVITY_POST_TIME=23:50

Copy link

github-actions bot commented Jul 20, 2024

File Coverage
All files 98%
logger.py 91%
main.py 97%
data/database/connection.py 92%
domain/localrepository/localwithingsrepository.py 94%
domain/usecases/slack/usecase_post_daily_activity.py 94%
domain/usecases/slack/usecase_post_sleep.py 97%
remoteservices/api/withings/subscribeapi.py 83%
remoteservices/api/withings/weightapi.py 93%
remoteservices/repositories/webapifitbitrepository.py 97%
routers/dependencies.py 85%
tasks/fitbitpoll.py 96%
tasks/post_daily_activities_task.py 95%

Minimum allowed coverage is 80%

Generated by 🐒 cobertura-action against b30e0e0

@caarmen caarmen force-pushed the activity-aggregation branch 3 times, most recently from 7708ee8 to 425ac6c Compare August 3, 2024 12:31
@caarmen caarmen force-pushed the activity-aggregation branch 4 times, most recently from d220864 to 14fb2a9 Compare August 11, 2024 00:26
@caarmen caarmen force-pushed the activity-aggregation branch 6 times, most recently from 7b8130c to a6a0c48 Compare August 11, 2024 16:12
@caarmen caarmen force-pushed the activity-aggregation branch 9 times, most recently from ff053aa to 086cdc0 Compare August 12, 2024 21:40
@caarmen caarmen force-pushed the activity-aggregation branch from 086cdc0 to 9758569 Compare August 13, 2024 21:13
@caarmen caarmen force-pushed the activity-aggregation branch 3 times, most recently from 3d83da3 to cb5f498 Compare August 13, 2024 22:14
@caarmen caarmen force-pushed the activity-aggregation branch 10 times, most recently from f9d276f to 4595a4f Compare August 18, 2024 12:05
@caarmen caarmen changed the title [WIP 🚧] Activity aggregation Activity aggregation Aug 18, 2024
@caarmen caarmen marked this pull request as ready for review August 18, 2024 12:06
@caarmen caarmen force-pushed the activity-aggregation branch from 4595a4f to b30e0e0 Compare August 18, 2024 12:14
Comment on lines +23 to +25
FITBIT_REALTIME_ACTIVITY_TYPE_IDS=[55001, 90013]
FITBIT_DAILY_ACTIVITY_TYPE_IDS=[90019]
FITBIT_DAILY_ACTIVITY_POST_TIME=23:50
Copy link
Owner Author

@caarmen caarmen Aug 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change:

  • Removed setting:
    • FITBIT_ACTIVITY_TYPE_IDS
  • Added settings:
    • FITBIT_REALTIME_ACTIVITY_TYPE_IDS
    • FITBIT_DAILY_ACTIVITY_TYPE_IDS
    • FITBIT_DAILY_ACTIVITY_POST_TIME

@caarmen caarmen merged commit e9eb2bf into main Aug 18, 2024
3 checks passed
@caarmen caarmen deleted the activity-aggregation branch August 18, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant