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

Update metoffice to use DataHub API #131425

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

avee87
Copy link
Contributor

@avee87 avee87 commented Nov 23, 2024

Breaking change

MetOffice is deprecating Datapoint API currently used by this integration and it's going to stop working in March 2025.
To keep integration working, it's now migrated to DataHub API.

To keep integration working, you will need to provide it a new API key which can be obtained by signing up for DataHub and subscribing to Global spot dataset. Free subscription provides 360 calls per day which is enough for this integration to work.

Some sensors have changed due to new data source:

  • visibility now returns a distance in meters as opposed to qualitative estimates
  • integration no longer exposes "daily" and "3-hourly" sensors, there is a single set of them now

Proposed change

  • Integration was rewritten to support the new API based on datapoint-python 0.10.0.
  • Updated forecast types to twice_daily and hourly to reflect the data returned by the API.
  • Added some new weather attributes provided by new API

I had to bump aio-geojson-generic-client dependency from 0.4 to 0.5 to avoid conflicts. Changelog explicitly references Home Assistant dependency conflicts as a primary reason for update so I don't expect this to cause issues.

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 Ruff (ruff format 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.

To help with the load of incoming pull requests:

@home-assistant
Copy link

Hey there @exxamalte, mind taking a look at this pull request as it has been labeled with an integration (geo_json_events) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of geo_json_events 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 geo_json_events 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.

@home-assistant
Copy link

Hey there @MrHarcombe, mind taking a look at this pull request as it has been labeled with an integration (metoffice) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of metoffice 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 metoffice 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.

@exxamalte
Copy link
Contributor

I had to bump aio-geojson-generic-client dependency from 0.4 to 0.5 to avoid conflicts. Changelog explicitly references Home Assistant dependency conflicts as a primary reason for update so I don't expect this to cause issues.

I'm happy to include this version bump here. Alternatively I could create a separate version bump PR, I simply haven't had a chance to do that yet.

Copy link
Contributor

@MrHarcombe MrHarcombe left a comment

Choose a reason for hiding this comment

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

Thanks for finding the time to get this done - appreciate it 👍

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.

MetOffice integration becoming redundant by 03/25 unless updated
4 participants