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

Add deviceId as an message input parameter #115

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

ckhmer1
Copy link
Contributor

@ckhmer1 ckhmer1 commented Jan 26, 2021

Hi,
first of all, thanks for your great job.
I'd like to specify the deviceId inside the message sent to the node and not always inside the node itself, like msg.deviceId= .....
It should is a simple fix, in ewelink-connect.js, just replaced the row:

    evaluatedParams.unshift(deviceId);
    // First parameter should be always the device ID

with following rows:

    let device_id = '';
    if (deviceId) {
      device_id = deviceId;
    } else if (typeof msg.deviceId !== "undefined") {
      device_id = msg.deviceId || '';
    }
    // First parameter should be always the device ID
    evaluatedParams.unshift(device_id);

In this way it the deviceId is not specified inside the node configuration, it will use the one specified inside the message.

Thanks
Claudio

@coveralls
Copy link

coveralls commented Jan 26, 2021

Pull Request Test Coverage Report for Build 93

  • 4 of 6 (66.67%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-4.5%) to 93.023%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/utils/ewelink-connect.js 4 6 66.67%
Totals Coverage Status
Change from base Build 84: -4.5%
Covered Lines: 101
Relevant Lines: 105

💛 - Coveralls

Copy link
Owner

@ottoszika ottoszika left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use additional variables, use the same deviceId (you can modify declaration to let instead of const or and you can do all of this inline at line 48).

@ckhmer1
Copy link
Contributor Author

ckhmer1 commented Mar 3, 2021

Don't use additional variables, use the same deviceId (you can modify declaration to let instead of const or and you can do all of this inline at line 48).

Done. Is it ok now?

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

Successfully merging this pull request may close these issues.

None yet

3 participants