Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions ewelink/ws.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import aiohttp, time, random, asyncio
import aiohttp, time, random, asyncio, json

from typing import AnyStr, TypedDict

Expand Down Expand Up @@ -84,7 +84,10 @@ async def update_device_status(self, deviceid: str, **kwargs: list[dict[str, Any

async def poll_event(self):
while True:
msg: dict[str, dict[str, bool | AnyStr] | AnyStr] = await self.ws.receive_json()
received = await self.ws.receive_str()
if received == 'pong':
continue
msg: dict[str, dict[str, bool | AnyStr] | AnyStr] = json.loads(received)
if action := msg.get('action', None):
match action:
case "sysmsg":
Expand Down