nordicopen / pyeasee

Easee EV charger API python library
MIT License
39 stars 11 forks source link

Requires "signalrcore", which is abandoned and outdated #90

Closed svenove closed 6 months ago

svenove commented 6 months ago

"pyeasee" has a requirement of "signalrcore=0.9.5", but that version is 2 years old and the "signalrcore"-project has been abandoned. I'm currently having issues with "signalrcore" requiring an old version of "websocket-client", causing problems for other projects that require never versions of the websocket-client.

I have no idea what "signalrcore" is or does, but is it possible to find a replacement for it in pyeasee?

olalid commented 6 months ago

Yes, I agree that this becoming problematic. Signalr is the protocol that the easee servers use to push out data to clients, so it is a crucial part of pyeasee. I am not sure what we should replace it with. There are some alternatives but not sure how well maintained they are either. This one?

https://pypi.org/project/pysignalr/

Or this one?

https://pypi.org/project/signalr-async/

svenove commented 6 months ago

Good question, both of them doesn’t seem to be actively maintained (but perhaps not abandoned?).

If using an old websocket-client is the only “problem” with the current one, there is a PR to fix/update compatibility with never websocket-client, but it hasn’t been merged: https://github.com/mandrewcito/signalrcore/pull/98

Could it be an alternative to use that PR as requirement for pyeasee? I haven’t tested the PR myself.

olalid commented 6 months ago

Well, that would mean we all of a sudden need to maintain a signalr lib as well, which should really be a last resort. Plus that if we anyway change things, we should go with an async compatible lib instead of signalrcore which is not async, which caused us some headache when originally implementing.

In any case, pysignalr is for some reason configured to require python <3.12, and since 3.12 is soon going to be a requirement to run home assistant that is not good. It might be easy to change, but currently not going to work.

signalr-async installs ok at least.

Neither of these libs seems to be dependant on websocket-client at all.

Note also that I tried installing websocket-client 1.7.0 and I can not see any resulting problems with signalrcore from doing that, so that could be a potential workaround until this has been fixed.

olalid commented 6 months ago

Actually, there are changes implemented in the pysignalr repository for python 3.12, but they have been done after the latest release.

svenove commented 6 months ago

Sounds like this is “solvable” then. :)

I’m not too familiar with HASS OS, but my understanding is that dependencies are checked on reboot and if manually install 1.7.0, it will downgrade to 1.0.0 if HASS is rebooted (due to version pinning in signalrcore)?

olalid commented 6 months ago

I do not think dependencies are checked on more than one level. It just verifies that pyeasee is installed at bootup. At least it did not downgrade it to 1.0.0 in my installation.

olalid commented 6 months ago

I made a quick test with https://pypi.org/project/pysignalr/ and it seems to work satisfactory. I have created an issue and asked for a release listed as supporting python 3.12, lets see if there is any response on that. If/when that is solved I can create a new version of pyeasee which uses this lib instead. If there is no response I have to re-think it...

olalid commented 6 months ago

See this PR: https://github.com/nordicopen/pyeasee/pull/91

olalid commented 6 months ago

See also https://github.com/nordicopen/easee_hass/pull/394

olalid commented 6 months ago

Easee component just released and should fix this issue.