Skip to content

Commit

Permalink
Update changelog and add error message to ispindel endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
thorrak committed Feb 15, 2020
1 parent 14db400 commit 30424c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 3 additions & 4 deletions docs/source/develop/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,15 @@ Fixed
---------------------

- Fixed where Fahrenheit readings coming from an iSpindel could be improperly reconverted to Fahrenheit
- Fixed issue where Tilt readings were not being properly decoded (Thanks NecroBrews!)
- Fixed issue where dashboard panels were not being updated (Thanks NecroBrews!)



[Unversioned] - Changes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Changed
---------------------

- Gravity sensors attached to BrewPi controllers will now send those controller's temps to Brewfather
- An explicit error message will now be displayed when a user attempts to manually access the ispindel endpoint



Expand Down
7 changes: 6 additions & 1 deletion gravity/views_ispindel.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ def ispindel_handler(request):
# As of iSpindel 6.2.0 it looks like this:
# {"name":"iSpindel001","ID":9390968,"token":"fermentrack","angle":68.81093,"temperature":73.175,"temp_units":"F","battery":4.103232,"gravity":22.80585,"interval":20,"RSSI":-41}

ispindel_data = json.loads(request.body.decode('utf-8'))
try:
ispindel_data = json.loads(request.body.decode('utf-8'))
except json.JSONDecodeError:
return JsonResponse({'status': 'failed', 'message': "No JSON data was posted (are you accessing this manually?)"}, safe=False,
json_dumps_params={'indent': 4})

with open(os.path.join(settings.BASE_DIR, "log", 'ispindel_json_output.log'), 'w') as logFile:
pprint.pprint(ispindel_data, logFile)

Expand Down

0 comments on commit 30424c7

Please sign in to comment.