Skip to main content

Python Interface for TryFi Dog Collars

Project description

pytryfi - Python Interface for TryFi

This 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.

Installation

To install this package, use pip

python -m pip install "pytryfi"

Usage

TryFi 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.

Example

#this will create the object and gather all the necessary data
tryfi = PyTryFi(username, password)
print(tryfi)

#this will perform a complete refresh of all Pets and data points
tryfi.updatePets()

#this will perform a complete refresh of all Bases and data points
tryfi.updateBases()

#this will perform an update on both Pets and Bases and their associated data points
tryfi.update()

#this will update the last reported location of a bet
tryfi.pets[0].updatePetLocation(tryfi.session)

#this will update the stats of the pet 
tryfi.pets[0].updateStats(tryfi.session)

#update the device/collar details for the given pet
tryfi.pets[0].updateDeviceDetails(tryfi.session)

#update the all details for a given pet
tryfi.pets[0].updateAllDetails(tryfi.session)

#this will set the light color of the collar
tryfi.pets[0].setLedColorCode(tryfi.session, 2)

#this will turn on the LED light on the color
tryfi.pets[0].turnOnOffLed(tryfi.session,True)
#or turn it off
tryfi.pets[0].turnOnOffLed(tryfi.session,False)

#this will turn on the lost dog mode
tryfi.pets[0].setLostDogMode(tryfi.session,True)
#or turn it off
tryfi.pets[0].setLostDogMode(tryfi.session,False)

#this will get the lost dog mode status/state currently in the object
tryfi.pets[0].isLost

To Do

  • Provide Activity Data History

Links:

Version History

0.0.13

  • Enhancement - removed error logging where not required
  • Fix - resolved issue where the variables are unbound in the login function

0.0.12

  • Enhancement - added Sentry for capturing errors by further only capturing exceptions

0.0.11

  • Enhancement - added Sentry for capturing errors

0.0.10

  • Enhancement - 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 walk

0.0.9

  • Bugfix - 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.8

  • Bugfix - handle unknown location

0.0.7

  • Bug fixes when updating objects

0.0.6

  • Added function to submit Lost Dog Action
  • Added isLost property to Pet
  • Code cleanup

0.0.5

  • Added global update function that updates both pets and bases (pytryfi.update())
  • Added better error handling

0.0.4

  • created update functions for various pet and device objects and a global update for the pet
  • added last updated date/time to the objects to track when the data was last updated
  • changed turn on/off action to boolean
  • when performing an action on the collar, update the data that is retrieved at the same time

0.0.3

The following updates/enhancements were made:

  • moved updated pet location from base object to pet class
  • created function to update the stats of the pet
  • converted approriate variables to integers, floats and dates
  • created function to set the LED color on the collar
  • created function to turn on/off LED on a collar

0.0.2

Initial version of the TryFi interface that gathered basic information about the pets, collars and bases.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jldeenpytryfi-0.0.14.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

jldeenpytryfi-0.0.14-py3-none-any.whl (17.6 kB view details)

Uploaded Python 3

File details

Details for the file jldeenpytryfi-0.0.14.tar.gz.

File metadata

  • Download URL: jldeenpytryfi-0.0.14.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for jldeenpytryfi-0.0.14.tar.gz
Algorithm Hash digest
SHA256 05be3ea780968285c5aaf37d1ca7d94088306a413c4500de9595a3ee4ea717db
MD5 cabbf5f0127a1bf573654e055d39a058
BLAKE2b-256 e8c31f09ba9ea48ea615f018c03f6347839a29a876af06b9f750638a59c97a5a

See more details on using hashes here.

File details

Details for the file jldeenpytryfi-0.0.14-py3-none-any.whl.

File metadata

  • Download URL: jldeenpytryfi-0.0.14-py3-none-any.whl
  • Upload date:
  • Size: 17.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

File hashes

Hashes for jldeenpytryfi-0.0.14-py3-none-any.whl
Algorithm Hash digest
SHA256 b39045be1e5e089e11d00f67852ebbf9251ab16b967c84adc829fc4331f9b2a4
MD5 c3269208c0dca2a12584eab8c5bdc714
BLAKE2b-256 f83e9ea3e6962c1c0d831a5d22b5c0889cc48bf19d9b2b88caebdb3cff33570b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page