This library defines3 main abstract concepts:
- A
RemoteScaleswhich 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
RemoteScalesScannerwhich is used to scan forRemoteScalesinstances that are supported, and - A
RemoteScalesPluginRegistrywhich 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 extendsRemoteScalesPluginand implement anapply()method which should register the plugin to theRemoteScalesPluginRegistrysingleton. - Import your new library together with the
remote_scaleslibrary and apply your plugin (i.e.MyScalesPlugin::apply()) during the initialisaion phase.