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

Fix issues with Point #100843

Closed
wants to merge 7 commits into from
Closed

Conversation

fredrike
Copy link
Contributor

@fredrike fredrike commented Sep 25, 2023

Proposed change

Fixes authentication issues with Point. Also fixes issues with other minor parts.

Changelog: fredrike/pypoint@v2.3.0...v2.3.2

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

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:

)
self._device_name = device_name
self._async_unsub_hook_dispatcher_connect = None
self._events = EVENTS[device_name]
self._attr_unique_id = f"point.{device_id}-{device_name}"
self._attr_icon = DEVICES[self._device_name].get("icon")
self._attr_name = f"{self._name} {device_name.capitalize()}"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is set in the super().__init__( function.

@fredrike fredrike marked this pull request as ready for review September 25, 2023 11:19
@@ -54,6 +55,7 @@
{
vol.Required(CONF_CLIENT_ID): cv.string,
vol.Required(CONF_CLIENT_SECRET): cv.string,
vol.Required(CONF_REDIRECT_URI): cv.string,
Copy link
Contributor

Choose a reason for hiding this comment

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

For integrations that connect to devices or services, we no longer accept new YAML configurations or changes.

More information about this can be found in Architecture Decision Record:

Please consider deprecating the yaml configuration as this integration already has a config flow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes I understand that, but I don't feel I have time right now to fix this. My roadmap for the integration is to move configuration to den config-flow.

Copy link
Contributor

Choose a reason for hiding this comment

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

As written above, we won't accept any yaml configuration changes.

The code is already importing the yaml config to a config entry. Therefore I suggest implementing the changes for the config entry config only.

In another PR, you should only deprecate the yaml config.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed all references to yaml config.

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant leaving the yaml configuration untouched.

I reviewed it again and saw that the UI-initialized config flow also requires yaml. Therefore, I suggest deprecating the yaml configuration in another PR first, including moving to the new oauth flow.

After the deprecation PR is merged, this bug-fix PR should be small and easy.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please implement the yaml depreciation here, including the new oauth flow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can I get some guidance on how to depricate yaml?

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But you want me to split this PR into several?

  1. Adding a config-flow dialog to allow redirect-uri
  2. Depricate yaml
  3. Implement full config-flow (as this pr is doing)

Copy link
Contributor

Choose a reason for hiding this comment

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

Well it is not possible to authenticate with the current yaml (it requires an uri). Hence we must send more information.

From your message, I assume it has to be one PR.

  • Adding a config-flow dialog to allow redirect-uri
  • Depricate yaml
  • Implement full config-flow (as this pr is doing)

Please make only these changes in this PR and try to keep the PR as small as possible.

@home-assistant home-assistant bot marked this pull request as draft September 25, 2023 12:29
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@fredrike fredrike marked this pull request as ready for review September 25, 2023 15:04
@home-assistant home-assistant bot requested a review from edenhaus September 25, 2023 15:04
@fredrike fredrike marked this pull request as draft September 25, 2023 19:52
@fredrike fredrike marked this pull request as ready for review October 2, 2023 06:11
@@ -54,6 +55,7 @@
{
vol.Required(CONF_CLIENT_ID): cv.string,
vol.Required(CONF_CLIENT_SECRET): cv.string,
vol.Required(CONF_REDIRECT_URI): cv.string,
Copy link
Contributor

Choose a reason for hiding this comment

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

I meant leaving the yaml configuration untouched.

I reviewed it again and saw that the UI-initialized config flow also requires yaml. Therefore, I suggest deprecating the yaml configuration in another PR first, including moving to the new oauth flow.

After the deprecation PR is merged, this bug-fix PR should be small and easy.

@home-assistant home-assistant bot marked this pull request as draft October 2, 2023 13:36
@fredrike fredrike mentioned this pull request Oct 13, 2023
20 tasks
Copy link

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
If you are the author of this PR, please leave a comment if you want to keep it open. Also, please rebase your PR onto the latest dev branch to ensure that it's up to date with the latest changes.
Thank you for your contribution!

@github-actions github-actions bot added the stale label Dec 12, 2023
@github-actions github-actions bot closed this Dec 19, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 20, 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.

Unable to setup authentication with Minut Point
2 participants