Skip to content

Commit

Permalink
See changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
9b committed Feb 24, 2018
1 parent 3026f87 commit 1049c8c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
4 changes: 4 additions & 0 deletions README.rst
Expand Up @@ -54,6 +54,10 @@ This library provides full control of the Hottop roaster. Built-in callback func

Changelog
---------
2017-02-24
~~~~~~~~~~
* Change: Added logic to add event code to find a valid configuration before saving

2017-02-10
~~~~~~~~~~
* Change: Added logic to turning point logic to avoid setting too soon
Expand Down
22 changes: 20 additions & 2 deletions pyhottop/pyhottop.py
Expand Up @@ -673,8 +673,26 @@ def add_roast_event(self, event):
:type event: dict
:returns: dict
"""
event.update({'time': self.get_roast_time(),
'config': self.get_roast_properties()['last']})
event_time = self.get_roast_time()

def get_valid_config():
"""Keep grabbing configs until we have a valid one.
In rare cases, the configuration will be invalid when the user
registers an event. This malformation can occur across several
events, so we use this helper to find a valid config to associate
to the event while preserving the original time. Due to fast
interval checking, this is not liable to skew data that much and
it's better than extreme false data.
"""
config = self.get_roast_properties()['last']
if not config['valid']:
self._log.debug("Invalid config at event time, retrying...")
self.get_valid_config()
return config

event.update({'time': event_time,
'config': get_valid_config()})
self._roast['events'].append(event)
return self.get_roast_properties()

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -8,7 +8,7 @@ def read(fname):

setup(
name='pyhottop',
version='0.2.1',
version='0.2.2',
description='Interface for interacting with Hottop KN-8828b-2k+ roasters',
url="https://github.com/splitkeycoffee/pyhottop",
author="Brandon Dixon",
Expand Down
4 changes: 4 additions & 0 deletions source/changelog.rst
Expand Up @@ -2,6 +2,10 @@ Changelog
=========
Running list of changes to the library.

2017-02-24
~~~~~~~~~~
* Change: Added logic to add event code to find a valid configuration before saving

2017-02-10
~~~~~~~~~~
* Change: Added logic to turning point logic to avoid setting too soon
Expand Down

0 comments on commit 1049c8c

Please sign in to comment.