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

refactor: make nodes a map instead of an array #710

Merged
merged 14 commits into from
Feb 24, 2021
Merged

Conversation

robertsLando
Copy link
Member

@robertsLando robertsLando commented Feb 23, 2021

ZwaveClient nodes is now a Map nodeId -> node

BREAKING CHANGE: getNodes function of ZwaveClient returns an array of available nodes but the index doesn't match the nodeId
refreshNeighbours returns a map nodeId -> neighbours[]
node removed socket event now returns the node removed
renamed setNodeName and setNodeLocation apis (removed the leading _) as now them also store the value to controller

Zwaveclient nodes will be a Map nodeId -> node

BREAKING CHANGE: `getNodes` function of client does return an array of only available nodes and the index doesn't match the actual nodeId, `refreshNeightbors`  returns an map nodeId -> neighborns[] and node removed socketr event payload has changed
@zwave-js-assistant
Copy link

🚧 It seems like this PR has lint errors 🚧

I should be able to fix them for you. If you want me to, just comment
@zwave-js-bot fix lint

lib/Gateway.js Outdated Show resolved Hide resolved
lib/ZwaveClient.js Outdated Show resolved Hide resolved
@robertsLando robertsLando added the BREAKING Breaking change label Feb 24, 2021
@zwave-js-assistant
Copy link

🚧 It seems like this PR has lint errors 🚧

I should be able to fix them for you. If you want me to, just comment
@zwave-js-bot fix lint

@coveralls
Copy link

coveralls commented Feb 24, 2021

Pull Request Test Coverage Report for Build 596496808

  • 2 of 208 (0.96%) changed or added relevant lines in 6 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.1%) to 19.031%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/components/nodes-table/nodes-table.js 0 2 0.0%
types/index.d.ts 0 2 0.0%
lib/Gateway.js 2 9 22.22%
app.js 0 28 0.0%
src/store/mutations.js 0 32 0.0%
lib/ZwaveClient.js 0 135 0.0%
Files with Coverage Reduction New Missed Lines %
src/components/nodes-table/nodes-table.js 1 0%
lib/Gateway.js 3 20.06%
Totals Coverage Status
Change from base Build 596489057: -0.1%
Covered Lines: 2019
Relevant Lines: 10885

💛 - Coveralls

@zwave-js-assistant
Copy link

🚧 It seems like this PR has lint errors 🚧

I should be able to fix them for you. If you want me to, just comment
@zwave-js-bot fix lint

@zwave-js-assistant
Copy link

🚧 It seems like this PR has lint errors 🚧

I should be able to fix them for you. If you want me to, just comment
@zwave-js-bot fix lint

@robertsLando robertsLando merged commit 5a43abd into master Feb 24, 2021
@robertsLando robertsLando deleted the nodes-map branch February 24, 2021 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING Breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] failednodes wont remove from control panel, same as closed bug #318
3 participants