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

Handle integrations with empty services or failing to load during service description enumeration #95911

Merged
merged 7 commits into from
Jul 6, 2023

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Jul 5, 2023

Proposed change

fixes #95581

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)
  • Deprecation (breaking change to happen in the future)
  • 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
  • I have followed the perfect PR recommendations
  • 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.

To help with the load of incoming pull requests:

@bdraco
Copy link
Member Author

bdraco commented Jul 5, 2023

Needs more manual testing on production

@bdraco
Copy link
Member Author

bdraco commented Jul 5, 2023

shell_command is a weird case here

shell_command % cat services.yaml

Empty file, shell_command services are dynamically created

Allowing it to be null is a problem because it breaks the frontend

      "shell_command": {
            "restart_pow": null,
            "call_remote": null
        },
ha-service-picker.ts:74 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'name')
    at ha-service-picker.ts:74:43
    at Array.forEach (<anonymous>)
    at F.<anonymous> (ha-service-picker.ts:67:10)
    at F.o [as _services] (memoize-one.esm.js:37:35)
    at F.<anonymous> (ha-service-picker.ts:93:38)
    at F.o [as _filteredServices] (memoize-one.esm.js:37:35)
    at F.value (ha-service-picker.ts:35:31)
    at F.update (lit-element.ts:160:24)
    at F.performUpdate (reactive-element.ts:1331:14)
    at F.scheduleUpdate (reactive-element.ts:1263:17)

@bdraco bdraco changed the title Handle integration failing to load during service description enumeration Handle integrations with empty services or failing to load during service description enumeration Jul 5, 2023
@bdraco bdraco marked this pull request as ready for review July 5, 2023 16:26
@bdraco bdraco requested a review from a team as a code owner July 5, 2023 16:26
@balloob balloob merged commit b7b8aff into dev Jul 6, 2023
@balloob balloob deleted the service_desc_95581 branch July 6, 2023 15:19
balloob pushed a commit that referenced this pull request Jul 6, 2023
…vice description enumeration (#95911)

* wip

* tweaks

* tweaks

* add coverage

* complain loudly as we never execpt this to happen

* ensure not None

* comment it
@balloob balloob mentioned this pull request Jul 6, 2023
joostlek pushed a commit to joostlek/core that referenced this pull request Jul 6, 2023
…vice description enumeration (home-assistant#95911)

* wip

* tweaks

* tweaks

* add coverage

* complain loudly as we never execpt this to happen

* ensure not None

* comment it
@elupus
Copy link
Contributor

elupus commented Jul 7, 2023

I wonder if this only partly fixed the issue: danieldotnl/ha-multiscrape#215 they seem too have a partial services.yaml.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 8, 2023
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.

ERROR (MainThread) [homeassistant.components.websocket_api.http.connection]
3 participants