Open Debenben opened 2 years ago
Thanks for this. I need to do a bit more testing with this so I'll do some this week with different hub types. I recognise the original issue though, good find.
@nathankellenicki Did you encounter any issues with this? For me this change works well and was sufficient to solve all issues.
If you are unsure, one could add a mechanism with a timeout to request the mode again if no response is recieved and additionally ignore messages that do not have the expected size.
During a couple of different tests, I came across the following problem, here illustrated in a reproducible way for motor rotation:
For my TechnicMediumHub this change is working perfectly and fixes the problem. I would recommend to test it with some different hub before merging though.
I am not happy about device._mode now having a setter function even though it is still labelled as readonly property, and also the names of the new function in general, but could not come up with better ones so far.