aiotractive icon indicating copy to clipboard operation
aiotractive copied to clipboard

HowTo Start?

Open sl4m01 opened this issue 2 months ago • 2 comments

Dear all, i am really happy i found this API script. I do have a cat using the current tractive tracker. But i am a pyhton beginner, therefor i am afraid i would need some help to start. Maybe someone could help me? :)

I am using a raspberry pi 4b and ssh connection. Performed pip install aiotractive and installed the script. Than i created a python file sudo nano test.py and enter the following code:

import asyncio

from aiotractive import Tractive

async def main():
  async with Tractive("[email protected]", "mypassword") as client:
    print(32) #just to test
    await client.authenticate()
    trackers = await client.trackers()
    tracker = trackers[0]
    await tracker.details()

# interact with the client here
    pass

if __name__ == "__main__":
  asyncio.run(main())

Saved and than i performed python test.py, no errors but only getting 32 (because of the test print command). The same using python3 test.py

If i do sudo python test.py i am getting following errors: Traceback (most recent call last): File "/home/test.py", line 4, in <module> from aiotractive import Tractive ModuleNotFoundError: No module named 'aiotractive'

Now i am pretty lost and dont know what to do or what to expect as a result. At least, if i type my mail or password wrong i am getting an authorization error as a result. Also getting an error if i type the tracker ID wrong. But i am just getting no results displayed in the ssh console.

Is the way i am doing this correct? Can someone help me? This would be very nice! Best regards Simon

sl4m01 avatar Apr 08 '24 07:04 sl4m01