Add support for TryFi Series 3+ behavior metrics and enhanced device info #8
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.
TryFi Series 3+ Support
Overview
This branch adds support for new metrics available in the TryFi Series 3+ collar.
New Features Added
Behavior Tracking
The Series 3+ collar includes AI-powered behavior detection. This update adds support for tracking:
Enhanced Device Information
New device properties for Series 3+ collars:
API Changes
New GraphQL Fragment
Added
FRAGMENT_BEHAVIOR_DETAILSto query behavior metrics with daily, weekly, and monthly breakdowns.New Query Method
Added
getCurrentPetBehaviorStats()to fetch behavior data from the API.FiPet Class Updates
setBehaviorStats()method to parse behavior dataupdateBehaviorStats()method to fetch latest behavior datadailyBarkingCount,weeklyLickingDuration, etc.)FiDevice Class Updates
Backward Compatibility
All changes are backward compatible. Older collar models will:
Usage Example
Testing
Due to the lack of access to a Series 3+ collar, these changes are based on TryFi's documentation and anticipated API structure. Testing with an actual Series 3+ collar is recommended to verify the GraphQL queries and response parsing.