Vendor idfm-api library into custom component#6
Merged
Conversation
- Copy the `idfm_api` source code from the custom fork (branch `feature/expose-request-error...`) directly into `custom_components/idfm/idfm_api/`. - Remove the external `git+https://` dependency from `manifest.json`. - Update all internal imports in the component (e.g., `from idfm_api import ...`) to relative imports (`from .idfm_api import ...`) to use the local copy. - This resolves dependency installation issues and ensures the component has access to the required `RequestError` class. - Update version to 2.3.2.
Changed Files
|
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.
This pull request introduces support for using multiple API keys with the IDFM integration to better handle rate limiting from the Île-de-France Mobilités PRIM API. It adds a new wrapper class to manage multiple keys, updates the integration to use this wrapper throughout, and improves documentation and attribution for the APIs and datasets used.
Multi-API Key Support:
MultiKeyIDFMApiwrapper class inapi_wrapper.pythat manages multiple API keys, automatically rotating between them when rate limits (HTTP 429) are encountered. This ensures continued service availability even when one key is rate limited.__init__.pyandconfig_flow.py) to parse and use multiple API keys, replacing direct use ofIDFMApiwithMultiKeyIDFMApiin all relevant places. [1] [2] [3] [4] [5]Refactoring and Internal Improvements:
idfm_apilibrary, ensuring the bundled version is always used. [1] [2] [3]Documentation and Attribution:
API_INFO.mdfile documenting how the integration uses the PRIM API, including endpoint details, authentication, and data sources.attribution.pywith clear licensing and data source references for both the open data and API components.Bundled API Library:
IDFMApilibrary directly into the integration underidfm_api/, ensuring all API logic is self-contained and maintained within the integration.These changes make the integration more robust against rate limiting, improve maintainability, and enhance transparency regarding data sources and licensing.