Skip to content

Add inclusion state to zwave_js/network_status WS API cmd#65398

Merged
MartinHjelmare merged 1 commit intohome-assistant:devfrom
raman325:inclusion_state
Feb 17, 2022
Merged

Add inclusion state to zwave_js/network_status WS API cmd#65398
MartinHjelmare merged 1 commit intohome-assistant:devfrom
raman325:inclusion_state

Conversation

@raman325
Copy link
Copy Markdown
Contributor

@raman325 raman325 commented Feb 2, 2022

Proposed change

In order to resolve #61855 the frontend needs to know the current inclusion state when opening the configuration page.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link
Copy Markdown

Hey there @home-assistant/z-wave, mind taking a look at this pull request as it has been labeled with an integration (zwave_js) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Looks good!

"suc_node_id": controller.suc_node_id,
"supports_timers": controller.supports_timers,
"is_heal_network_active": controller.is_heal_network_active,
"inclusion_state": controller.inclusion_state,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

should I explicitly use controller.inclusion_state.value to make it more clear?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think it matters. It will be converted to a number by the json serializer before the websocket consumer gets it. It's the possible values that may be interesting and those aren't shown anyway by the code here.

@MartinHjelmare
Copy link
Copy Markdown
Member

CC @bramkragten

@MartinHjelmare
Copy link
Copy Markdown
Member

We'd like the frontend, if inclusion/exclusion is in progress, show a cancel action instead of the add/remove action.

@MartinHjelmare MartinHjelmare marked this pull request as draft February 2, 2022 00:44
@MartinHjelmare
Copy link
Copy Markdown
Member

Converting to draft until frontend team approves.

@raman325
Copy link
Copy Markdown
Contributor Author

raman325 commented Feb 2, 2022

One other frontend quirk I noticed when I started looking into this is that we check for the connecting status in a bunch of conditionals (example https://github.com/home-assistant/frontend/blob/dev/src/panels/config/integrations/integration-panels/zwave_js/zwave_js-config-dashboard.ts#L116)

But the property that's being read can only ever be connected or disconnected (https://github.com/home-assistant/core/blob/dev/homeassistant/components/zwave_js/api.py#L370) so I don't think this code is working unless I am missing something.

@MartinHjelmare
Copy link
Copy Markdown
Member

Frontend PR is merged.

@MartinHjelmare MartinHjelmare merged commit a1b81b2 into home-assistant:dev Feb 17, 2022
@raman325 raman325 deleted the inclusion_state branch February 17, 2022 17:54
@github-actions github-actions bot locked and limited conversation to collaborators Feb 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Z-Wave JS Add Device can appear to hang if the frontend is closed abruptly

3 participants