Heidelberg: Revert pre-fill of streets and ignore timezone on Christmas tree collection parse #3502
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.
During inspection of the failed CI pipeline on my last pull request (#3497 / #3498), I recognized that using
CONFIG_FLOW_TYPES
with a public method call has unexpected side effects. Whenever the file is being imported (e.g., by runningtest_sources.py
orupdate_docu_links.py
), theSource.get_available_streets()
method is being called in order to fill theCONFIG_FLOW_TYPES
dictionary even without access to values of the dictionary at all. This leads to unnecessary and maybe excessive calls to the public API. It's visible in this pipeline run here.First, I thought about answering calls from both test/debug scripts with an empty list using this workaround:
But, honestly, I'm pretty sure there may be cases the file is being imported by HA/HACS I'm not aware of right now. And checking the stack-trace on runtime in production environments is pretty nasty. Therefore, I decided to revert this change entirely. In case the street entered by the user isn't correct, I call the API anyway and present the result as suggestions.
Additionally, I ignore the local timezone information now when parsing the Christmas tree collection date in order to avoid shifting it to another date unexpectedly.
Sorry for any inconvenience I caused!