-
-
Notifications
You must be signed in to change notification settings - Fork 33.1k
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
Add Open-Meteo integration #60379
Add Open-Meteo integration #60379
Conversation
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.
I interpret the dev docs to mean that a forecast is required for weather entities, although it isn't very explicit on this point. Otherwise this is just a group of sensors.
https://developers.home-assistant.io/docs/core/entity/weather/
Forecast in not required. I have left it out for the initial PR and kept everything as small as possible. |
entity_id: state.name | ||
for entity_id in self.hass.states.async_entity_ids(ZONE_DOMAIN) | ||
if entity_id != ENTITY_ID_HOME | ||
and (state := self.hass.states.get(entity_id)) is not None |
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.
No need to check this as you get the entity IDs from the state machine.
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.
Actually, I do, as the comprehension uses state.name
, as the returned state can be None
it needs to be checked (typing completeness).
@property | ||
def condition(self) -> str | None: | ||
"""Return the current condition.""" | ||
if not self.coordinator.data.current_weather: |
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.
Should this be implemented as the available
property instead?
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.
Yes/no, in the end, current_weather
can return None
from the API, thus needs to be checked as typing demands it :)
Marking the PR as draft, to ensure it keeps out of .12 (as I won't have time to complete it/extend it before beta starts). |
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.
Should consider the changes that this PR introduces around units: #59533
Co-authored-by: MatthewFlamm <[email protected]>
4c8ba27
to
94a9ed0
Compare
This reverts commit d802f3a.
Proposed change
Add an initial step towards adding the Open-Meteo integration:
https://open-meteo.com/en
Open-Meteo offers free weather forecast APIs for open-source developers and non-commercial use. No API key is required.
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: