Custom device uuid
Opened this issue · 2 comments
sadrzadehsina commented
Hi,
I am wondering is there any way to assign a custom uuid for a device. like below:
DeviceDriver = function() {
this.uuid = "<uuid>";
Device.call(this);
}
just need to have a consistent uuid
.
AdamMagaluk commented
I believe you can manually override it with something like:
DeviceDriver = function() {
// Device constructor first sets the id = uuid.v4()
Device.call(this);
// Override it after that.
this.id = "<uuid>";
}
sadrzadehsina commented
@AdamMagaluk it does not work as expected. Here is what I did.
var Water = module.exports = function DeviceDriver() {
Device.call(this);
this.id = "12121212-1111-1111-1111-121212121212";
}
Here is the JSON returned which you can see the id is the default one.