p-doyle/Python-KasaSmartPowerStrip

json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 1021 (char 1020)

Closed this issue · 6 comments

Hello -

Just wanted to let you know that I was receiving this error while talking to a TP-Link HS300:

json.decoder.JSONDecodeError: Unterminated string starting at: line 1 column 1021 (char 1020)

I was able to correct the issue by changing line 211 from this:

data, server = client_socket.recvfrom(1024)

to this:

data, server = client_socket.recvfrom(2048)

Can you send an example of what the raw message was? Its an easy update, just not something I encountered during my testing so I'm curious.

Oh sorry I mean the message that came in from the HS300. Wondering what caused the increased length from what I've seen in the past.

Ah nevermind, don't worry about it. I've updated the code.

Thanks for reporting!