Skip to content

Commit

Permalink
Add a couple new properties
Browse files Browse the repository at this point in the history
Add start_time property to PGoApi and request_id to RpcState.
  • Loading branch information
Noctem committed Mar 4, 2017
1 parent 06ec484 commit 2535b53
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions aiopogo/pgoapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ def activate_hash_server(self, hash_token):
def get_hash_server_token(self):
return self._hash_server_token

@property
def start_time(self):
return self._state.start_time

async def __getattr__(self, func):
async def function(**kwargs):
request = self.create_request()
Expand Down
7 changes: 5 additions & 2 deletions aiopogo/rpc_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ async def _build_main_request(self, subrequests, player_position=None):
request = RequestEnvelope()
request.status_code = 2

request.request_id = self.state.id_gen.request_id()
request.request_id = self.state.request_id

# 5: 43%, 10: 30%, 30: 5%, 50: 4%, 65: 10%, 200: 1%, float: 7%
request.accuracy = rand.choose_weighted(
Expand Down Expand Up @@ -481,7 +481,10 @@ def __init__(self):
self.mag_z_max = self.mag_y_min + 15
self._course = rand.uniform(0, 359.99)
self.message8 = None
self.first_request = None

@property
def request_id(self):
return self.id_gen.request_id()

@property
def magnetic_field_x(self):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
author = 'David Christenson',
author_email='mail@noctem.xyz',
description = 'Asynchronous Pokemon API lib',
version = '1.3.3',
version = '1.3.4',
url = 'https://github.com/Noctem/aiopogo',
packages = find_packages(),
install_requires = [
Expand Down

0 comments on commit 2535b53

Please sign in to comment.