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
Bump pyipma to 3.0.2 #76332
Conversation
Hey there @abmantis, mind taking a look at this pull request as it has been labeled with an integration ( |
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
@@ -18,6 +18,13 @@ def __init__(self): | |||
"""Init IpmaFlowHandler.""" | |||
self._errors = {} | |||
|
|||
async def async_step_import(self, config): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: