Migrate SAJ eSolar integration to the current Elekeeper API client#121
Open
jaesbit wants to merge 1 commit into
Open
Migrate SAJ eSolar integration to the current Elekeeper API client#121jaesbit wants to merge 1 commit into
jaesbit wants to merge 1 commit into
Conversation
Owner
|
Hi @jaesbit, Would you be intrested in becoming the maintainer of the integration ? i do not use it anymore and also @santiagozky is not using it anymore. There for you PR was missed. I Think it would be a great addition. Let me know and i can add you to the list. |
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.
Hi,
This PR proposes a larger modernization of the integration by moving the SAJ eSolar cloud communication into a dedicated Python client library:
pysaj-elekeeper.The current implementation still relies on the older portal/API flow and keeps a lot of request, parsing and authentication logic inside the Home Assistant integration itself. This change moves that responsibility into the library and updates the integration to consume the current Elekeeper API used by the newer SAJ web portal.
What this brings
pysaj-elekeeper.DataUpdateCoordinator.Why a separate library
The Elekeeper API requires several details that are not ideal to keep duplicated inside a Home Assistant custom component:
The client library is available here: https://github.com/giovadroid/pysaj-elekeeper
Keeping this logic in a standalone package should make it easier to maintain, test and reuse outside this custom component if other SAJ/Elekeeper integrations need the same API layer.
Notes
This is a bigger change than the previous small fixes I contributed in #85 and #88. Those were targeted fixes around the existing API flow; this PR moves the integration toward the newer Elekeeper API model and should make future maintenance easier if the older endpoints are changed or deprecated.
The library currently exposes the import module as
elekeeper, while the package requirement ispysaj-elekeeper.Validation
python3 -m py_compile custom_components/saj_esolar/*.pygit diff --check