diff --git a/pokemongo_bot/__init__.py b/pokemongo_bot/__init__.py index 3c720d348a..958044af86 100644 --- a/pokemongo_bot/__init__.py +++ b/pokemongo_bot/__init__.py @@ -177,7 +177,7 @@ def _register_events(self): 'wake' ) ) - + # random pause self.event_manager.register_event( 'next_random_pause', @@ -382,7 +382,7 @@ def _register_events(self): ) self.event_manager.register_event( 'next_egg_incubates', - parameters=('distance_in_km',) + parameters=('km_needed', 'distance_in_km',) ) self.event_manager.register_event('incubator_already_used') self.event_manager.register_event('egg_already_incubating') diff --git a/pokemongo_bot/cell_workers/incubate_eggs.py b/pokemongo_bot/cell_workers/incubate_eggs.py index 805129435b..ea4621586d 100644 --- a/pokemongo_bot/cell_workers/incubate_eggs.py +++ b/pokemongo_bot/cell_workers/incubate_eggs.py @@ -34,8 +34,9 @@ def work(self): else: self.emit_event( 'next_egg_incubates', - formatted='Next egg incubates in {distance_in_km:.2f} km', + formatted='Next egg ({km_needed} km) incubates in {distance_in_km:.2f} km', data={ + 'km_needed': self.used_incubators[0]['km_needed'], 'distance_in_km': km_left } ) @@ -118,9 +119,12 @@ def _check_inventory(self, lookup_ids=[]): incubators = [incubators] for incubator in incubators: if 'pokemon_id' in incubator: + start_km = incubator.get('start_km_walked', 9001) + km_walked = incubator.get('target_km_walked', 9001) temp_used_incubators.append({ "id": incubator.get('id', -1), - "km": incubator.get('target_km_walked', 9001) + "km": km_walked, + "km_needed": (km_walked - start_km) }) else: temp_ready_incubators.append({