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

Use new API for Vasttrafik #102570

Merged
merged 5 commits into from Oct 27, 2023
Merged

Use new API for Vasttrafik #102570

merged 5 commits into from Oct 27, 2023

Conversation

Miicroo
Copy link
Contributor

@Miicroo Miicroo commented Oct 23, 2023

Breaking change

Västtrafik has upgraded all infrastructure for handling external API calls, including handling user accounts for 3rd party applications. This means that users of the older infrastructure now need to migrate to use the new environment. Create a new account at https://developer.vasttrafik.se, then create a new application and subscribe to the Planera Resa v4 API. Then replace your old client identifier and secret in your HomeAssistant configuration.

See this official post from Västtrafik.
Change since last version: From v0.1.14 to v0.2.1

Proposed change

This change uses the new API and new responses. The old API has already been closed for new applications, so with this PR new users are able to start using the Västtrafik sensors again.

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:

@elupus
Copy link
Contributor

elupus commented Oct 24, 2023

Please add a link to the new release of the library to the pull request.

@Miicroo
Copy link
Contributor Author

Miicroo commented Oct 24, 2023

Link to library release added

@edenhaus

This comment was marked as outdated.

@edenhaus
Copy link
Contributor

Link to library release added

This is only a link to pypi, but we require at least one (or multiple) of the following:

  • A link to the release notes of this package version, and all versions in between.
  • A link to the changelog of this package.
  • A link to a Git(Hub) diff/compare view from the current version to the bumped version.

This allows us to review upstream changes, which is needed to decide this change is working as intended and/or if we can include it in, for example, a patch release of Home Assistant.

Thanks already! 👍

@elupus
Copy link
Contributor

elupus commented Oct 26, 2023

The blog post says:

The last date to migrate from using https://api.vasttrafik.se is therefore 30 November 2023.

Instead of creating a hard-breaking change, would it be possible to detect the old api usage and create a repair issue instead? An support both apis until the 30.11?

This would give the users a month of time to do the migration.

Better a hard breaking change from one release of HA to another, than a API breaking change on the 30 of november leaving users to wait for a new HA.

I think hard breaking directly is fine here. Its so short time to the API shutting down (from next ha release), that we wont gain anything by that.

@Miicroo
Copy link
Contributor Author

Miicroo commented Oct 27, 2023

  • A link to a Git(Hub) diff/compare view from the current version to the bumped version.

Aha, that makes sense! I should release the version on Github too, did only release it on pypi. Since I took over from the last developer (who won't be maintinaing it anymore), I think that the diff between the repos will be the best representation of the changes. PR description is now updated, let me know if it is missing something.

Copy link
Contributor

@edenhaus edenhaus left a comment

Choose a reason for hiding this comment

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

Thanks @Miicroo
We will include it in the next beta as the API is shutting down on 30.11

@edenhaus edenhaus added this to the 2023.11.0 milestone Oct 27, 2023
@edenhaus edenhaus changed the title Use new Vasttrafik API Planera Resa v4 Use new API for Vasttrafik Oct 27, 2023
@edenhaus edenhaus merged commit a516f32 into home-assistant:dev Oct 27, 2023
53 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2023
@Miicroo Miicroo deleted the use_vasttrafik_api_v4 branch October 30, 2023 08:21
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.

None yet

4 participants