This library defines3 main abstract concepts:
- A
RemoteScales
which is used as a common interface to connect to scales, retrieve their weight and tare. It also supports a callback that is triggered when a new weight is received. - A
RemoteScalesScanner
which is used to scan forRemoteScales
instances that are supported, and - A
RemoteScalesPluginRegistry
which holds all the scales that are supported by the library.
This allows for easy extention of the library for more bluetooth enabled scales.
- Acaia Lunar - [Tested]
- Acaia Pearl - [Tested]
- Bookoo Themis - [Tested]
There is a big possibility other acaia models work out of the box as well but thye have not ben tested!
Want a specific model? Implement it 🚀 Read on to find out how...
We can do this either in this repo or in a separate repo. In both cases we need to:
- Create a class for the new Scales (i.e.
AcaiaScales
) that implements the protocol of the scales and extendsRemoteScales
. This is 99.9% of the work as it involves reverse engineering or reading the datasheet of the scales and implementing it accordingly. - Create a plugin (i.e.
AcaiaScalesPlugin
) that extendsRemoteScalesPlugin
and implement anapply()
method which should register the plugin to theRemoteScalesPluginRegistry
singleton. - Import your new library together with the
remote_scales
library and apply your plugin (i.e.MyScalesPlugin::apply()
) during the initialisaion phase.