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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump pyipma to 3.0.2 #76332

Merged
merged 5 commits into from Aug 31, 2022
Merged

Bump pyipma to 3.0.2 #76332

merged 5 commits into from Aug 31, 2022

Conversation

dgomes
Copy link
Contributor

@dgomes dgomes commented Aug 6, 2022

Proposed change

Major refactor of the supporting library due to API updates, but backward compatibility was kept

Changelog: dgomes/pyipma@2.1.5...3.0.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
  • 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.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 馃 Silver
  • 馃 Gold
  • 馃弳 Platinum

To help with the load of incoming pull requests:

@probot-home-assistant
Copy link

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

@dgomes dgomes changed the title Bump pyipma to 3.0.0 Bump pyipma to 3.0.2 Aug 6, 2022
Comment on lines -90 to -112
async def async_setup_platform(
hass: HomeAssistant,
config: ConfigType,
async_add_entities: AddEntitiesCallback,
discovery_info: DiscoveryInfoType | None = None,
) -> None:
"""Set up the ipma platform.

Deprecated.
"""
_LOGGER.warning("Loading IPMA via platform config is deprecated")

latitude = config.get(CONF_LATITUDE, hass.config.latitude)
longitude = config.get(CONF_LONGITUDE, hass.config.longitude)

if None in (latitude, longitude):
_LOGGER.error("Latitude or longitude not set in Home Assistant config")
return

api = await async_get_api(hass)
location = await async_get_location(hass, api, latitude, longitude)

async_add_entities([IPMAWeather(location, api, config)], True)
Copy link
Member

Choose a reason for hiding this comment

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

It seems like this never triggered an import?
Should we still do that first?
What about raising a repairs issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

config_flow was added so long ago that there was no migrate code at the time :)

I've addressed the comment by adding async_step_import

Dev automation moved this from Needs review to Review in progress Aug 8, 2022
@balloob balloob merged commit f98e86d into home-assistant:dev Aug 31, 2022
Dev automation moved this from Review in progress to Done Aug 31, 2022
@@ -18,6 +18,13 @@ def __init__(self):
"""Init IpmaFlowHandler."""
self._errors = {}

async def async_step_import(self, config):
Copy link
Member

Choose a reason for hiding this comment

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

What will import a config here? The platform setup is removed and there's no async_setup in the init module.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are absolutely right

Checking history it hasn't been possible to use YAML since 2019, so I created #77674 to cleanup this

@github-actions github-actions bot locked and limited conversation to collaborators Sep 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants