[0.7.0] Introduce Device resource. Remove deprecated DataBatch/DataPoint.
Compatibility and Deprecation
This is a breaking release for anyone still using DataPoint
or DataBatch
in their code. These types have been removed and associated methods in the client have been removed. The top level package now contains 3 members: Builder
, DataStore
(formerly DataBatch
), and Device
. Due to the introduction of the Device
object, some old
interfaces may print deprecation warnings (see below).
Device object
Device
is a representation of devices that simplifies some interfaces so that we don't need to pass around their id, name, and type as separate parameters. These old interfaces will work for the remainder of v0.7.x series, but will be removed in a future release (possibly v0.8.0). Usage of the old interfaces will trigger deprecation warnings. To create a device object:
// Name and type are optional
var device = new iobeam.Device('my_id', 'my_name', 'my_type');
Registering from the client:
var iobeamClient = ...
// No callback
iobeamClient.register(device);
// With callback
function regCallback(success, device, error) {
if (success) {
console.log("New device: " + device.getId());
} else {
console.log(error);
}
}
iobeamClient.register(device, regCallback);