sillyfrog / Automate-Pulse-v2

Rollease Acmeda Automate Pulse Hub v2 integration for Home Assistant
Apache License 2.0
37 stars 8 forks source link

Unable to add hub #34

Closed cp119900 closed 2 weeks ago

cp119900 commented 2 weeks ago

Traceback (most recent call last): File "/usr/local/lib/python3.12/site-packages/aiopulse2/devices.py", line 252, in heartbeat if self.ws and self.ws.open and self.handshake.is_set(): ^^^^^^^^^^^^ AttributeError: 'ClientConnection' object has no attribute 'open'

According to the pulse app, i am on firmware 1.10.0

Core: 2024.11.1 Supervisor: 2024.11.2 Operating System: 13.2 Frontend: 20241106.2

kwanm84 commented 2 weeks ago

I just upgraded to 24.11.1 and all my blinds went offline. I removed and tried to readd my hubs.. and same error.

yyli commented 2 weeks ago

I got the same error

yyli commented 2 weeks ago

I dug in an it's cause the new websockets version doesn't have open or handshake. It has this but it says not to use https://websockets.readthedocs.io/en/stable/reference/asyncio/client.html#websockets.asyncio.client.ClientConnection.state

Quick and dirty i changed https://github.com/sillyfrog/aiopulse2/blob/master/aiopulse2/devices.py#L252 to

            if self.ws and self.ws.state == 1:

Probably not exactly the right fix but this is the issue

kwanm84 commented 2 weeks ago

Probably not exactly the right fix but this is the issue

Thank you... got mine working until it can be fixed officially.

lionslair commented 2 weeks ago

Yeah I have seen that I do not have any blinds showing today. I have similar issue in logs.

Logger: homeassistant
Source: /usr/src/homeassistant/homeassistant/runner.py:147
First occurred: 7:02:18 AM (2 occurrences)
Last logged: 7:06:03 AM

Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/aiopulse2/devices.py", line 252, in heartbeat
    if self.ws and self.ws.open and self.handshake.is_set():
                   ^^^^^^^^^^^^
AttributeError: 'ClientConnection' object has no attribute 'open'
red-centre commented 2 weeks ago

Sorry for the complete ignorance, but could you tell me what's involved in doing this?

Quick and dirty i changed https://github.com/sillyfrog/aiopulse2/blob/master/aiopulse2/devices.py#L252 to

sillyfrog commented 2 weeks ago

I've just pushed a new release (v0.10.0) for this that handles the new API for the websockets library (which has been updated in the latest Home Assistant).

lionslair commented 2 weeks ago

I've just pushed a new release (v0.10.0) for this that handles the new API for the websockets library (which has been updated in the latest Home Assistant).

Thank you for the fast fix. Very much appreciated.