sampsyo / wideq

reverse-engineered client for the LG SmartThinQ API
https://pypi.org/project/wideq/
MIT License
327 stars 160 forks source link

Merging with ha-smartthinq-sensor wideq implementation #99

Open ollo69 opened 4 years ago

ollo69 commented 4 years ago

Hi,

think time is come to try to merge my project with your original work. I start opening an issue and not a PR because I reorganize the project structure in many point and so create a PR is not so simple. I start trying to recap here main changes of my implementation:

Ready here for any suggestion on the best way to proceed or to provide additional detail of my changes.

sampsyo commented 4 years ago

Sounds great; I would love to help with this!

Here are a few questions based on your summary of the reorganization:

Anyway, shall we start with the "v2" core and client stuff? IMO we can begin by merging the core stuff (i.e., the pure "functions" for communicating with the API). Then we can add the Client and Device classes on top of that. Does that seem feasible?

ollo69 commented 4 years ago

Well,

I merged core and client because client class, as is implemented, cannot be independent by the version. Honestly I leaved both 2 module (core and core_v2) just because I want to preserve orginal API, but finally I discovered that the V1 version is not used anymore because core_v2 can manage both thinq1 and thinq2 devices.

I think that is complex to explain without viewing the code, maybe I can create a PR with all changes just with the objective to discuss directly on the code itself and let you take a look on that, than we can choose to discard PR and create a new one.

Let me know what do you think.

sampsyo commented 4 years ago

OK cool, let’s abandon v1 then and just implement v2.

And sounds good; a PR might help me understand why the two (core and client) need to be coupled in v2.

ollo69 commented 4 years ago

Ok, created PR #100, let's continue there....

stefxx commented 4 years ago

Great work in progress!

Do you already know how to control basic features of a v2 device? I guess it needs the thinq2Uri from the gateway-uri response... but do we have a json example of what the LG API expects?

Thanks!