Development¶
Contributing¶
Brewmeister is free and open source software and you are encouraged to report bugs, contribute features and bug fixes as well as translating the Brewmeister into your language.
Bug reports and feature requests¶
All bugs and feature requests should be reported at the GitHub issue tracker.
Code contributions¶
Common open source practices apply to the Brewmeister development too. First of all, all code contributions are reviewed and merged through a GitHub pull request. Please base your changes on a feature branched off of master and not master itself. Name it according to your intended changes, e.g. fix-bug-123 or add-magic-hops.
Within your code, you should follow PEP8 with one exception: the line length can be up to 100 characters per line instead of 80.
Translations¶
The easiest way to add or improve translations is to go to the Transifex project page and request a new language or start digging on the existing ones. This is the preferred way for translators, as the messages source file is uploaded when necessary.
You can also add and translate manually. First create a new language with make createpo, enter the targetted language code and edit the translation file in brew/translations/<lang>/LC_MESSAGES/messages.po. Once finished, you can add and commit this file and issue a pull request on GitHub.
Arduino Brew Control Protocol¶
The Arduino Brew Control Protocol (short ABCP) is a simple, compact, stateless and command-based wire protocol for communicating with a Brewmeister-compatible Arduino.
The following specification assumes, the host to be the machine that communicates with the Arduino via a serial line interface.
Protocol sequence¶
Communication is always initiated by the host using a simple call-response sequence:
- Host sends command packet specifying either to read or to write data.
- Host sends device packet specifying which device is addressed.
- In case of a write command, the host sends the data.
- The Arduino answers with a status code and depending on the command, optional data.
Command packet¶
The command packet is sent by the host and consists of one header byte
Code | Meaning |
---|---|
0xf0 | Read data |
0xf1 | Write data |
and one device byte.
Code | Instrument | Data type | Meaning |
---|---|---|---|
0xf1 | Temperature | float | Temperature in degree Celsius. |
0xf2 | Heat | bool | On or off. |
0xf3 | Stir | bool | On or off. |
Data types¶
Data can – as of now – be sent and read as floats or boolean data types. A float is a four byte IEEE compliant float data type in x86-compatible little endian format. The boolean type is one byte, with 0 denoting false and 1 denoting true.
RESTful HTTP API¶
Recipes¶
- POST /api/recipe¶
Create a new recipe. The data must be encoded as a JSON data structure according to the JSON schema stored in data/recipe.schema.json.
- PUT /api/recipe/(int: recipe_id)¶
Recipe data of (recipe_id).
Brews¶
- GET /api/brews¶
List of brew IDs.
- GET /api/brews/(int: brew_id)/temperature¶
Archived temperature data for (brew_id).
- GET /api/brews/(int: brew_id)/label¶
Return a PDF called qr.pdf containing small QR codes for bottle caps.
- GET /api/brews/(int: brew_id)/temperature¶
Get all recorded temperatures of the specified brew.
- GET /api/brews/(int: brew_id)/label/prepare¶
Prepare a label asynchronously.
- PUT /api/brews/(int: brew_id)/note¶
Update notes of brew.
- GET /api/status¶
Status of the current brew.