Package: jldeenpytryfi
pytryfi - Python Interface for TryFiThis python interface enables you to gather information about your dogs whereabouts, your user details and any bases you may have.NOTE: Since this interacts with undocumented APIs, this may change without notice.InstallationTo install this package, use pippython-mpipinstall"pytryfi"UsageTryFi uses Graphql for its APIs. Essentially, you will use your username (email address) and password to retrieve a unique username specific for API calls which in turn will be used for the duration to retrieve data.Login Script with Debugging Support# Export env variables
fi_user=user@user.com
fi_pass=secretpassword

# When running in Dev container, uncomment & use the args in the `launch.json` file for vscode
fi_user=user@user.com
fi_pass=secretpassword

# run script in terminal
python login.py

# Alternatively run script in debugger and set breakpoints as needed
hit F5 to start the debuggerExample#this will create the object and gather all the necessary datatryfi=PyTryFi(username,password)print(tryfi)#this will perform a complete refresh of all Pets and data pointstryfi.updatePets()#this will perform a complete refresh of all Bases and data pointstryfi.updateBases()#this will perform an update on both Pets and Bases and their associated data pointstryfi.update()#this will update the last reported location of a bettryfi.pets[0].updatePetLocation(tryfi.session)#this will update the stats of the pettryfi.pets[0].updateStats(tryfi.session)#this will update rest (nap/sleep) stats of the pettryfi.pets[0].updateRestStats(tryfi.session)#update the device/collar details for the given pettryfi.pets[0].updateDeviceDetails(tryfi.session)#update the all details for a given pettryfi.pets[0].updateAllDetails(tryfi.session)#this will set the light color of the collartryfi.pets[0].setLedColorCode(tryfi.session,2)#this will turn on the LED light on the colortryfi.pets[0].turnOnOffLed(tryfi.session,True)#or turn it offtryfi.pets[0].turnOnOffLed(tryfi.session,False)#this will turn on the lost dog modetryfi.pets[0].setLostDogMode(tryfi.session,True)#or turn it offtryfi.pets[0].setLostDogMode(tryfi.session,False)#this will get the lost dog mode status/state currently in the objecttryfi.pets[0].isLost#this will query sleep stats for given pettryfi.pets[0].dailySleeptryfi.pets[0].weeklySleeptryfi.pets[0].monthlySleep#this will query nap stats for given pettryfi.pets[0].dailyNaptryfi.pets[0].weeklyNaptryfi.pets[0].monthlyNapTo DoProvide Activity Data HistoryLinks:TryFiVersion History0.0.18Maintenance - Removal of walkversion which is being deprecated and no longer required.0.0.17Enhancement - added 3 functions to get the Activity Type, Current Place Name and Current Place Address0.0.16Fix - removed hardcoding of a single household. Households are iterated through for pets and bases.0.0.15Enhancement - added Sleep and Nap statistics. If the collar doesn't support this feature it defaults to zero.0.0.14Fix - resolved issue between V1 and V2 of the TryFi collars where the isCharging property doesn't exist in V2. This causes failed parsing errors and some users get a ledOn error as a symptom in hass-tryfi (Home Assistant - TryFi implementation)0.0.13Enhancement - removed error logging where not requiredFix - resolved issue where the variables are unbound in the login function0.0.12Enhancement - added Sentry for capturing errors by further only capturing exceptions0.0.11Enhancement - added Sentry for capturing errors0.0.10Enhancement - added areaName property that could be used to idenitfy a location (tryfi.pets[0].areaName)Bugfix - fixed longitude and latitude while Pet is on a walk0.0.9Bugfix - get LED status based on additional logic that compares the ledOffAt date with the current date/time. Update the boolean to True or False base on the additional date comparison.0.0.8Bugfix - handle unknown location0.0.7Bug fixes when updating objects0.0.6Added function to submit Lost Dog ActionAdded isLost property to PetCode cleanup0.0.5Added global update function that updates both pets and bases (pytryfi.update())Added better error handling0.0.4created update functions for various pet and device objects and a global update for the petadded last updated date/time to the objects to track when the data was last updatedchanged turn on/off action to booleanwhen performing an action on the collar, update the data that is retrieved at the same time0.0.3The following updates/enhancements were made:moved updated pet location from base object to pet classcreated function to update the stats of the petconverted approriate variables to integers, floats and datescreated function to set the LED color on the collarcreated function to turn on/off LED on a collar0.0.2Initial version of the TryFi interface that gathered basic information about the pets, collars and bases.