Skip to content

Conversation

@theobld-ww
Copy link
Contributor

Proposed change

Add a check in the Watts Vision config flow to verify cloud component is enabled in configuration. This prevents users trying to set up the integration without cloud enabled.

Type of change

  • New feature (which adds functionality to an existing integration)

Checklist

  • I understand the code I am submitting and can explain how it works.
  • 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][dev-checklist]
  • I have followed the [perfect PR recommendations][perfect-pr]
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

@home-assistant
Copy link

Hey there @devender-verma-ww, @ssi-spyro, mind taking a look at this pull request as it has been labeled with an integration (watts) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of watts can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign watts Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the pull request.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a cloud component enablement check to the Watts Vision integration's OAuth2 configuration flow. The check prevents users from attempting to set up the integration when the required cloud component is not enabled in their Home Assistant configuration.

  • Implements a cloud component check in async_step_user that aborts the config flow if cloud is not available
  • Adds a user-facing error message for the cloud_not_enabled abort reason
  • Updates all existing config flow tests to include the use_cloud fixture
  • Adds a new test specifically for the cloud_not_enabled scenario

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
homeassistant/components/watts/config_flow.py Adds async_step_user method to check for cloud component availability before proceeding with OAuth2 flow
homeassistant/components/watts/strings.json Adds error message for the cloud_not_enabled abort reason
tests/components/watts/test_config_flow.py Adds use_cloud fixture, new test for cloud_not_enabled scenario, and updates all existing tests to use the fixture

@joostlek joostlek closed this Dec 30, 2025
@joostlek joostlek reopened this Dec 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants