kukulich / home-assistant-jablotron100

Home Assistant custom component for JABLOTRON 100+ alarm system
MIT License
67 stars 24 forks source link

Fix loop in check_serial_port when connected via usbip #30

Closed PeterPalenik closed 2 years ago

PeterPalenik commented 2 years ago

When I tried running the integration over usbip, I encountered a problem in check_serial_port method. It looks like the reader thread is reading too fast and it reads the writer's data before it gets flushed to the alarm control unit, so the unit never gets the data and never responds. As a quick fix, I added a sleep to the reader loop to slow down reading. Actually is there a reason why the code is parallel? Can't the same thing be done in serial manner?

kukulich commented 2 years ago

It looks it will probably not break anything so I'll merge it.