Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom device uuid #355

Open
sadrzadehsina opened this issue Jul 28, 2017 · 2 comments
Open

Custom device uuid #355

sadrzadehsina opened this issue Jul 28, 2017 · 2 comments

Comments

@sadrzadehsina
Copy link

sadrzadehsina commented Jul 28, 2017

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
Copy link
Collaborator

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
Copy link
Author

@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";
}

Still use the default uuid.
screen shot 2017-07-28 at 8 07 54 pm

Here is the JSON returned which you can see the id is the default one.
screen shot 2017-07-28 at 8 09 52 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants