-
Notifications
You must be signed in to change notification settings - Fork 91
allow use commands by simple subscriptions/notifications #1734
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
Conversation
|
Maybe useCmdBySubs should use a string value instead of true/false to make it more extensible? I mean:
|
| } | ||
|
|
||
| function updateRegisterDevice(deviceObj, previousDevice, entityInfoUpdated, callback) { | ||
| // |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover? Or incomplete comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 93c8902
| apply(extractDeviceDifference, deviceObj), | ||
| createInitialEntityNgsi2Fake, | ||
| apply(combineWithNewDevice, deviceObj), | ||
| // |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leftover? Or incomplete comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 93c8902
| .reduce(mergeWithSameName, []); | ||
|
|
||
| if (attrs.length === 0) { | ||
| logger.debug(context, 'Subscription is not needed. Device without lazy attrs or commands'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if the references to "lazy attrs" is correct here... The subscription will only cover the commands case, not lazy attributes.
| config.storeLastMeasure = config.storeLastMeasure === true; | ||
| } | ||
| if (process.env.IOTA_CMD_MODE) { | ||
| config.cmdMode = process.env.IOTA_CMD_MODE; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the new config item / env var be described in some .md file? Not sure, but I think to remember we have a document about configurations...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 93c8902
|
Coverage show s -0.2% decrease. Although I have seen some test has been modified to align with the new implementation, is the new logic covered by new tests? |
|
CNR entry should be added describing the changes in this PR (new fields added, basically) |
|
Still work in progress |
|
@fgalan this PR (and related PRs) is ready |
|
Clarified entity creation conditions regarding commands and attributes.
Co-authored-by: Fermín Galán Márquez <[email protected]>
Co-authored-by: Fermín Galán Márquez <[email protected]>
fgalan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Issue: #1732