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

ChoiceType array crash due to value name #170

Closed
danWithAD opened this issue Apr 24, 2020 · 7 comments
Closed

ChoiceType array crash due to value name #170

danWithAD opened this issue Apr 24, 2020 · 7 comments
Assignees

Comments

@danWithAD
Copy link

I've run into this simultaneously in local and remote running instance of node-hue-api.

Error log is as follows,

Failed to get a remote connection using existing tokens.
ApiError: Value 'allreadytoinstall' is not one of the allowed values [unknown,noupdates,transferring,anyreadytoinstall,allreadtoinstall,installing]

I've temporarily fixed this by adding the following to node_modules/node-hue-api/lib/types/ChoiceType.js


  _convertToType(val) {
    if (this.validValues.indexOf(val) > -1 || val === 'allreadytoinstall') {
      return val;
    } else {
      throw new ApiError(`Value '${val}' is not one of the allowed values [${this.validValues}]`);
    }
  }
@peter-murray
Copy link
Owner

It appears that hue has added another value to this choice type,

I will modify the values and give you a pre release to test with later today.

@peter-murray peter-murray self-assigned this Apr 24, 2020
@danWithAD
Copy link
Author

Thank you so much!

@peter-murray
Copy link
Owner

peter-murray commented Apr 24, 2020

This has been fixed in 5.0.0-alpha.2 which is in the npm registry (or at least it has in my local testing).

Due to this being a fix that will be required in the 4.x releases, I have just released this change in 4.0.6 as well.

@danWithAD please verify when you get a chance

@danWithAD
Copy link
Author

@peter-murray I can confirm that in both local and prod pulling the latest version from master repo works!

@dtsn
Copy link

dtsn commented Jun 11, 2020

@peter-murray did you patch 4.0.6? Just forced an update on 4.0.6 and I don't get the change. Looking at the tag in github it appears to be missing https://github.com/peter-murray/node-hue-api/blob/v4.0.6/lib/model/BridgeConfiguration.js#L36

peter-murray added a commit that referenced this issue Jun 11, 2020
@peter-murray
Copy link
Owner

@dtsn Sorry about that, looks like I failed to apply the actual commit for the fix and just cherry-picked two other commits that referenced it 🤦

I have released 4.0.7 with the correct fix in it now, please try pulling that version from the npm registry.

@dtsn
Copy link

dtsn commented Jun 12, 2020

@peter-murray Works great! Thanks.

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

3 participants