-
Notifications
You must be signed in to change notification settings - Fork 1
(tests) Adding more test cases #20
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
Closed
Closed
Conversation
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
This is a clean implementation that only adds new functionality without reverting any of @ajacques' optimizations: 1. Added getPetHealthTrends() function to query.py for fetching behavior data 2. Added behavior tracking to fiPet.py as purely additive methods: - updateBehaviorStats() - fetches behavior data for Series 3+ collars - setBehaviorStatsFromTrends() - parses the API response - Added behavior properties (dailyBarkingCount, etc.) - Modified updateAllDetails() to call updateBehaviorStats() without changing the existing GraphQL batching optimization 3. Added PetBehaviorSensor class to sensor.py for Home Assistant entities Key points: - NO changes to updatePets() - preserves batched updates - NO changes to error handling - preserves @ajacques' improvements - NO removal of type hints - updateAllDetails() still uses getPetAllInfo() for batched GraphQL - Behavior tracking is purely additive, only called for Series 3+ collars - All tests pass Co-authored-by: @ajacques
Per @ajacques' review comments: - Removed sentry_sdk imports - Removed all capture_exception() calls - Libraries should not initialize Sentry as it can conflict with user applications - Errors should bubble up naturally for proper error handling This addresses the inline review comments about Sentry usage in the library.
…info (tryfi#15) 1. Added getPetHealthTrends() function to query.py for fetching behavior data 2. Added behavior tracking to fiPet.py as purely additive methods: - updateBehaviorStats() - fetches behavior data for Series 3+ collars - setBehaviorStatsFromTrends() - parses the API response - Added behavior properties (dailyBarkingCount, etc.) - Modified updateAllDetails() to call updateBehaviorStats() without changing the existing GraphQL batching optimization 3. Added PetBehaviorSensor class to sensor.py for Home Assistant entities --------- Co-authored-by: Adam Jacob Muller <adam@adam.gs> Co-authored-by: Adam Jacques <ajacques@users.noreply.github.com>
getHouseholds already gives us the information we need to bootstrap the FiUser, so no point in making a call just for the current user.
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.
This pull request adds a bunch of test cases for pytryfi and for the Home Assistant integration flow