Closed uzlonewolf closed 2 years ago
Nice! Thanks @uzlonewolf - This is a very clean / elegant approach and I'm trying to remember why we/I didn't address this already. I remember having it in my TODO list to address the multi-palyload condition.
On the second bit, I understand and appreciate the exception approach. I can see that as a breaking change for some users. I want to run through some tests to see how serious that would be before decide on version increment, etc.
Thank you!
It shouldn't be a breaking change as it's only called from within the try/except block in _send_receive()
- the except Exception as err:
line will catch it and retry if there are any retries remaining.
Though now that I think about it, that retry may be a breaking change - previously, decode errors were caught a bit further down and resulted in a json error being returned instead of a retry. To restore this behavior we would just need to throw a specific exception and have a catch for it.
This PR:
self.socket.recv()
into its own functionTuyaMessage()
named tuplelog.debug()
messages if the header, footer, or CRC are wrongCloses #152