Improve Serial sensor platform with full options for configuring the serial port.
bytesize, parity, stopbits, xonxoff, rtscts, dsrdtr.
The default values are unchanged so it is 100% compatible with previous config.
* Fix serial integration connection stability
Retry to connect if serial device is not available on start, or connection is lost.
Added some more log entries upon connection or when errors are encountered.
* Updated code based on review
* Fixed exception indentation
* Handle SerialException
* Sort imports
* Update homeassistant/components/serial/sensor.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* Update homeassistant/components/serial/sensor.py
Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>
* More clean up
* Format and delint
* Extract error handler
* Clean up stop handler
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Consolidate
* Fix tests
* Update imports
* Fix import
* Use importlib because integration and package share name
* Fix more tests
* Update .coveragerc and CODEOWNERS