
Webhooks & Firehoses
FD1 Scale/Weighing Devices
These functions allow you to query available weighing devices and control them. Scales are usually configured to send weight values as they become available, so in general interfacing to scales involves handling the random inbound messages received over the websocket
To use scales in your application
- Pair with a scale using fd1.devices.pair_to_scale This only needs to be done once and we suggest you save the pairing either locally in the browser or on your session (or both!)
- Setup a message handler to receive fd1.devices.scale_read_ready events
- Optionally, use fd1.devices.enable_scale_reading to control if you are wanting to actively receive scale events. This function allows multiple browsers to potentially share a scale by requesting access to it.
fd1.devices.get_scale_devices
Fetch allocated and potentially available scale and weighing devices
Example.
{ a: "fd1.devices.get_scale_devices", q: { latitude: -34.892344, longitude: 174.99988872, location: 45 } }