-
-
Notifications
You must be signed in to change notification settings - Fork 32k
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
Add SensorPush Cloud integration #134223
base: dev
Are you sure you want to change the base?
Add SensorPush Cloud integration #134223
Conversation
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 putting in the effort and going for a second attempt at this! However, I see the libraries are not compliant yet as, sensorpush-api
's source code is not public and under an OSI approved license https://developers.home-assistant.io/docs/core/integration-quality-scale/rules/dependency-transparency
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
Thanks! The source code for the Python library is public (I'm the author), however you are correct that the license is not OSI approved. I could use some advice here if you don't mind. OpenAPI generated the original source, which I then modified to work with HA. The license information was generated based on information in the Swagger definition, which references SensorPush's EULA. What have other authors done in this case? |
bae7af7
to
79bf167
Compare
I could only find the -ha lib on GitHub. The other one I could only find on PyPi but not in a repo. I guess most will publish to a repo and adapt the license there |
Huh, that's odd. You should be able to find both libraries on PyPI: I'll work on re-licensing sensorpush-api in the meantime. I suspect this is just an artifact of OpenAPI. |
Yes on PyPi. But that’s not a code repo (like GitHub). You'll need to put the code (+releases & CICD) there as well. |
Ah! That's strange, I'm not sure why the repository link is absent. I'll look into it. Everything is on GitHub and releases are managed by CI/CD: |
829f651
to
11dee32
Compare
Hi @zweckj - I've corrected the license terms for |
ec21702
to
8678976
Compare
4b0c94f
to
5a63c7d
Compare
Latest round of changes in! PR is ready for review - thanks again for the feedback! |
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.
Hey welcome back, how have you been?
errors: dict[str, str] = {} | ||
if user_input is not None: | ||
email, password = user_input[CONF_EMAIL], user_input[CONF_PASSWORD] | ||
await self.async_set_unique_id(email, raise_on_progress=False) |
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.
also, do you get any tokens from sensorpush? Are we sure we don't have an user id to use
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.
The only token we receive is a short-lived token used for API calls, nothing that would be suitable as a unique ID. SensorPush also relies on email addresses rather than user IDs.
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.
Are they JWTs by any chance?
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.
No, it appears to be completely bespoke.
Good! A little less busy this time around! I hope everyone had a good holiday break. |
e78b67a
to
19746cd
Compare
3deb491
to
4720db2
Compare
@joostlek Requested changes have been made. Thanks again! |
4720db2
to
8bc4fcc
Compare
8bc4fcc
to
beb5765
Compare
Apologies, I just rebased the branch without realizing there was a workflow run! |
Proposed change
This PR adds cloud integration for SensorPush devices. It communicates with the publicly available Cloud API using the sensorpush-api and sensorpush-ha Python packages. Care was taken to ensure that presented devices appeared the same as those created by the existing SensorPush integration. A G1 WiFi Gateway is required to make use of the Cloud API.
Note
This PR is a re-submission of #121890, which fixes several issues reported by reviewers. I would like to send a heartfelt apology to @joostlek, @edenhaus, and @frenck - I was caught between dueling schedules and I wasn't able to do the work needed to get it over the finish line. I was finally able to put in the time over the holiday break to make requested changes in addition to improved unit tests, strict typing, async dependencies, and websession injection (whew!)
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: