Add weather symbol text and condition mapping for forecasts - #388
Draft
felix-hoc wants to merge 1 commit into
Draft
Add weather symbol text and condition mapping for forecasts#388felix-hoc wants to merge 1 commit into
felix-hoc wants to merge 1 commit into
Conversation
The forecast weather symbol (sy parameter) is only available as a numeric code and the code list is not part of the API metadata. Add the official German descriptions, unofficial English translations and a mapping to Home Assistant weather condition strings, based on Geosphere-Austria/dataset-api-docs#30 get_forecast_current() now includes sy_text and condition, and the trimmed forecast payload gets derived sy_text and condition parameter series alongside the existing rain and wind_speed ones. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Author
|
@killer0071234 Please let me know if this feature is wanted in general - if so, I am happy to incorporate change requests :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds translation of the forecast weather symbol (
syparameter) into words:zamg.symbolsmodule with the official German descriptions (SYMBOL_TEXT_DE), unofficial English translations (SYMBOL_TEXT_EN) and a mapping to Home Assistant weather condition strings (SYMBOL_CONDITION), plussymbol_to_text()/symbol_to_condition()helpersget_forecast_current()now returnssy_textandconditionalongside the rawsycodeget_forecast()gets derivedsy_textandconditionparameter series, same pattern as the existingrainandwind_speedWhy
The
sycode list is not part of the API metadata; the only official source is the (German only) table in Geosphere-Austria/dataset-api-docs#30. Every consumer currently has to copy that table by hand.This is also groundwork for the Home Assistant
zamgintegration: the weather entity has noconditionproperty and always shows unknown (home-assistant/core#161571). Withconditionavailable from the library, the HA integration can populate the weather entity state and an hourly forecast fromget_forecast(). Happy to follow up with that HA core PR after this is released.Notes
SYMBOL_TEXT_ENis a best-effort translation; the official German text is available viasymbol_to_text(code, lang="de")conditionintentionally never returnsclear-night— the library does not know the sun position, so the consumer has to swapsunnyforclear-nightat night (documented in the module)🤖 Generated with Claude Code