-
Notifications
You must be signed in to change notification settings - Fork 142
Issue228 cleanup activity changes #229
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
Conversation
….NET-1 into redmorello-async-portable Init Merge
… shout be a "-" and not null
…of the null values
…wanted change. Reverted back
…the heart acvtivity models for ease of use. Also decided to kill the new heart rate methods (one's that allowed for a date string or a timespan)
…aarondcoleman/Fitbit.NET into issue228-CleanupActivityChanges Took all local changes in merge
WestDiscGolf
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I think there may have been a couple of items missed from the original pull request which need tweaking.
| public Fixture fixture { get; set; } | ||
|
|
||
| [TestFixtureSetUp] | ||
| [OneTimeSetUp] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New one on me :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our CI build agents didn't like TestFixtureSetUp used with V3 of the test framework ;-|
| <None Include="SampleData\ApiSubscriptionNotification.json" /> | ||
| <None Include="SampleData\GetActivities.json" /> | ||
| <None Include="SampleData\GetHeartRateTimeSeries.json"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be different from the others?
| </None> | ||
| <None Include="SampleData\GetHeartRateIntradayTimeSeries.json" /> | ||
| <None Include="SampleData\GetActivityLogsList.json"> | ||
| <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above? need to be different?
| Task<ApiSubscription> AddSubscriptionAsync(APICollectionType apiCollectionType, string uniqueSubscriptionId, string subscriberId = default(string)); | ||
| Task DeleteSubscriptionAsync(APICollectionType collection, string uniqueSubscriptionId, string subscriberId = null); | ||
| Task<ActivityLog> LogActivityAsync(ActivityLog model); | ||
| Task<HeartActivitiesTimeSeries> GetHeartRateTimeSeries(DateTime date, DateRangePeriod dateRangePeriod, string userId = "-"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetHeartRateTimeSeriesAsync to keep with the pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetHeartRateTimeSeries is the name used in current versions. RedMorello updated it, but this is a braking change so we're gonna keep it the same for now.
Fitbit.NET/Fitbit.Portable/FitbitClient.cs
Line 396 in 079c870
| public async Task<HeartActivitiesTimeSeries> GetHeartRateTimeSeries(DateTime date, DateRangePeriod dateRangePeriod, string userId = null) |
| Task DeleteSubscriptionAsync(APICollectionType collection, string uniqueSubscriptionId, string subscriberId = null); | ||
| Task<ActivityLog> LogActivityAsync(ActivityLog model); | ||
| Task<HeartActivitiesTimeSeries> GetHeartRateTimeSeries(DateTime date, DateRangePeriod dateRangePeriod, string userId = "-"); | ||
| Task<HeartActivitiesIntraday> GetHeartRateIntraday(DateTime date, HeartRateResolution resolution, string userId = "-"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetHeartRateIntradayAsync to keep with the pattern
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fitbit.NET/Fitbit.Portable/FitbitClient.cs
Line 422 in 079c870
| public async Task<HeartActivitiesIntraday> GetHeartRateIntraday(DateTime date, HeartRateResolution resolution) |
| public int Value { get; set; } | ||
| } | ||
|
|
||
| public class IntradayActivitiesHeart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All classes should be in their own files :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| [JsonProperty(PropertyName = "activities-heart-intraday")] | ||
| public ActivitesHeartIntraday ActivitiesHeartIntraday { get; set; } | ||
| } | ||
| public class ActivitesHeart |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All classes should be in their own files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fitbit.Portable/FitbitClient.cs
Outdated
| public async Task<List<ActivityLogsList>> GetActivityLogsList(DateTime? beforeDate, DateTime? afterDate, int limit = 20, string encodedUserId = default(string)) | ||
| { | ||
| var apiCall = string.Empty; | ||
| limit = limit > 20 ? 20 : limit; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the check for negative values as per the original code review / pull request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fitbit.Portable/FitbitClient.cs
Outdated
| return (new JsonDotNetSerializer() { RootProperty = "activities" }).Deserialize<List<ActivityLogsList>>(responseBody); | ||
| } | ||
|
|
||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra whitespace not needed between methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Fitbit.Portable/FitbitClient.cs
Outdated
| /// <returns></returns> | ||
| public async Task<HeartActivitiesTimeSeries> GetHeartRateTimeSeries(DateTime date, DateRangePeriod dateRangePeriod, string userId = "-") | ||
| { | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra whitespace not needed in methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
aarondcoleman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
FIxes #228
An extension of the changes from Redmorello