-
Notifications
You must be signed in to change notification settings - Fork 27
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
Fix issue with 'async_request_refresh' #40
Conversation
This call generates a HTTP query on every access to sensor or forecasts. Basically it forces HA to refresh forecast many times a second insted of once in 30 minutes. + add unique id to all sensors + add a separate weather service for daily mode if enabled
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 think FMI have recently changed the OAAS sea level query so that it now returns two types of sea level measurements, with the parameters in the query being called ‘SeaLevel’ (as it was before) but also now a new ‘SeaLevelN2000’ measurement. So I think that a “starts with SeaLevel” type of parsing line might cause unintended results as it would presumably pick up both of the measurement types from the data?
Hi again @tdragon,
|
Good point. I am not really interested in the SeaLevel, but seen an error in the log and quickly fixed it. |
Thanks. I think a potential issue with your amended fix is that it will flood the log with “unsupported record” lines. The FMI sea level data fetch brings in half hourly forecast data for two days ahead, and for each time point it now has both a ‘SeaLevel’ and ‘SeaLevelN2000’ entry. So every time the sensor updates, you would see nearly a hundred log lines on unsupported records. I think the parsing over the forecast would best work if it followed the below logic:
That way it would only create a log entry if something unexpected came up when parsing the data. |
Ok, I added a skipping of the ‘SeaLevelN2000' without logging. |
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.
Thanks for changing this!
No description provided.