From fc9cde1d69437ac032c0d57b93f4dd457e5a7f06 Mon Sep 17 00:00:00 2001
From: Gleb Sinyavskiy <zhulik.gleb@gmail.com>
Date: Sat, 22 May 2021 01:22:35 +0200
Subject: [PATCH 1/4] Add readme, remove unused method, bump version

---
 README.md              | 108 +++++++++++++++++++++++++++++++++++++++++
 aiotractive/tracker.py |  10 ----
 setup.py               |   2 +-
 3 files changed, 109 insertions(+), 11 deletions(-)

diff --git a/README.md b/README.md
index cf1918d..bdb2c3f 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,109 @@
 ## aiotractive
+
+![Continuous Integration](https://github.com/zhulik/aiotractive/workflows/Continuous%20Integration/badge.svg?branch=main)
+
+**Unofficial** Asynchronous Python client for the [Tractive](https://tractive.com) REST API.
+
+**This project and it's author are not affilated with Tractive GmbH**
+
+This project is a result of reverse engineering of the Tractive web app.
+
+Inspired by [home_assistant_tractive](https://github.com/Danielhiversen/home_assistant_tractive).
+
+Initially some code was borrowed from home_assistant_tractive, but in the end all of it was replaced with my own implementation.
+
+The package is in active development. **Not all features available in the Tractive web app are implemented.**
+
+Important notes:
+
+- In order to use Tractive devices and their service you need to have an active subscription.
+- Tractive may change their API at any point of time and this project will be broken. Please, report any issues.
+
+## Installation
+
+`pip install aiotractive`
+
+## Usage
+
+```python
+import asyncio
+
+from aiotractive import Tractive
+
+async def main():
+  async with Tractive("email", "password") as client:
+    # interact with the client here
+    pass
+
+if __name__ == "__main__":
+  asyncio.run(main())
+```
+
+
+### Tractive
+
+Tractive is the entrypoint class, it acts as an async context manager and provides access to API endpoints.
+
+#### Authentication
+
+```python
+client.authenticate()
+
+# {'user_id': 'user_id', 'client_id': 'client_id', 'expires_at': 1626821491, 'access_token': 'long access token'}
+```
+
+#### Trackers
+
+```python
+trackers = await client.trackers()
+tracker = trackers[0]
+
+# Or
+
+tracker = client.tracker("TRACKER_ID")
+
+# Retrieve details
+await trackers.details() # Includes device capabilities, battery status(not level), charging state and so on
+
+await tracker.hw_info() # Includes battery level, firmware version, model and so on
+
+# Retrieve current location 
+await tracker.pos_report() # Includes coordinates, latitude, speed and so on
+# Retrieve hardware info
+
+# Control the buzzer
+await set_buzzer_active(True) # or False
+
+# Control the LED
+await set_led_active(True) # or False
+
+# Control the live tracking
+await set_live_tracking_active(True) # or False
+```
+
+#### Trackable objects (usually pets)
+```python
+objects = await client.trackable_objects()
+
+object = objects[0]
+
+# Retrieve details
+await object.details() # Includes pet's name, pet's tracker id and so on
+```
+
+#### Events
+
+```python
+async for event in client.events():
+    pp(event)
+
+```
+
+After connecting you will immidiately receive one `tracker_status` event per owned tracker.
+The first event always includes full current status of the tracker including current position, battery level, states of the buzzer, the LED and the live tracking.
+
+All following events will have the same name, but will only include one of these: either a position, battery info, or a buzzer/LED/live status.
+
+
+## Contribution
+You know;)
diff --git a/aiotractive/tracker.py b/aiotractive/tracker.py
index 4790b8f..362ae32 100644
--- a/aiotractive/tracker.py
+++ b/aiotractive/tracker.py
@@ -12,16 +12,6 @@ async def details(self):
     async def hw_info(self):
         return await self._api.request(f"device_hw_report/{self._id}/")
 
-    async def positions(self, time_from=datetime.now() - timedelta(hours=6), time_to=datetime.now()):
-        return await self._api.request(
-            f"tracker/{self._id}/positions",
-            params={
-                "time_from": round(time_from.timestamp()),
-                "time_to": round(time_to.timestamp()),
-                "format": "json_segments",
-            },
-        )
-
     async def pos_report(self):
         return await self._api.request(
             f"device_pos_report/{self._id}",
diff --git a/setup.py b/setup.py
index d7c700c..5e9666e 100644
--- a/setup.py
+++ b/setup.py
@@ -8,7 +8,7 @@
 
 setup(
     name="aiotractive",
-    version="0.4.0",
+    version="0.5.0",
     author="Gleb Sinyavskiy",
     author_email="zhulik.gleb@gmail.com",
     description="Asynchronous Python client for the Tractive REST API",

From 8462a8ac72a05dcda1625e6fe0d6f0fa4c2ccd10 Mon Sep 17 00:00:00 2001
From: Gleb Sinyavskiy <zhulik.gleb@gmail.com>
Date: Sat, 22 May 2021 01:26:06 +0200
Subject: [PATCH 2/4] Typo

---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index bdb2c3f..dc4d8eb 100644
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@ This project is a result of reverse engineering of the Tractive web app.
 
 Inspired by [home_assistant_tractive](https://github.com/Danielhiversen/home_assistant_tractive).
 
-Initially some code was borrowed from home_assistant_tractive, but in the end all of it was replaced with my own implementation.
+Initially some code was borrowed from home_assistant_tractive, but in the end all of it was replaced with my own implementations.
 
 The package is in active development. **Not all features available in the Tractive web app are implemented.**
 
@@ -99,7 +99,7 @@ async for event in client.events():
 
 ```
 
-After connecting you will immidiately receive one `tracker_status` event per owned tracker.
+After connecting you will immediately receive one `tracker_status` event per owned tracker.
 The first event always includes full current status of the tracker including current position, battery level, states of the buzzer, the LED and the live tracking.
 
 All following events will have the same name, but will only include one of these: either a position, battery info, or a buzzer/LED/live status.

From 09ac33c5828007ae6c9592e25379825fbec23f1f Mon Sep 17 00:00:00 2001
From: Gleb Sinyavskiy <zhulik.gleb@gmail.com>
Date: Sat, 22 May 2021 01:49:33 +0200
Subject: [PATCH 3/4] Remove unused imports

---
 aiotractive/tracker.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/aiotractive/tracker.py b/aiotractive/tracker.py
index 362ae32..7a5a6e4 100644
--- a/aiotractive/tracker.py
+++ b/aiotractive/tracker.py
@@ -1,5 +1,3 @@
-from datetime import datetime, timedelta
-
 from .data_object import DataObject
 
 

From debeea15303d3b06775dc5cd96a1ce570fdec986 Mon Sep 17 00:00:00 2001
From: Gleb Sinyavskiy <zhulik.gleb@gmail.com>
Date: Sat, 22 May 2021 01:51:01 +0200
Subject: [PATCH 4/4] Readme

---
 README.md | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index dc4d8eb..1f093be 100644
--- a/README.md
+++ b/README.md
@@ -100,10 +100,11 @@ async for event in client.events():
 ```
 
 After connecting you will immediately receive one `tracker_status` event per owned tracker.
-The first event always includes full current status of the tracker including current position, battery level, states of the buzzer, the LED and the live tracking.
-
-All following events will have the same name, but will only include one of these: either a position, battery info, or a buzzer/LED/live status.
+The first event always includes full current status of the tracker including current position, battery level, states of the buzzer,
+the LED and the live tracking.
 
+All following events will have the same name, but only include one of these: either a position, battery info, or a buzzer/LED/live
+status.
 
 ## Contribution
 You know;)