name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
Describe the bug
For unknown reasons my currentcost usb-serial interface loses connection intermittently. In the process the script crashes and is dead/unresponsive until hass is restarted.
To Reproduce
Steps to reproduce the behaviour, including error message if any.
Expected behaviour
Gracefully handle any serial port failures and recover.
By adding a <try, except> over the reader.readline the scripts seems to recover properly. Probably have to add some delay or timeout in exception handling to prevent excessive logging.
while True:
try:
line = await reader.readline()
line = line.decode("utf-8").strip()
_LOGGER.debug("Line Received: %s", line)
except:
_LOGGER.error("Error reading from serial port")
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop/Server/Device (please complete the following information):
Device used to run the Custom Component [e.g. Raspberry Pi, NUC]
Method of installation [e.g. via HACS or manual]
Version of the Custom Component installed?
Model of the Current Cost Device
Additional context
Add any other context about the problem here.
Logs
Please set the Current Cost Custom Component's logging level to debug and provide relevant logs section from Home-Assistant.
To Enable debug logging level, add this to your configuration.yaml and restart:
name: Bug report about: Create a report to help us improve title: '' labels: bug assignees: ''
Describe the bug For unknown reasons my currentcost usb-serial interface loses connection intermittently. In the process the script crashes and is dead/unresponsive until hass is restarted.
To Reproduce Steps to reproduce the behaviour, including error message if any.
Expected behaviour Gracefully handle any serial port failures and recover. By adding a <try, except> over the reader.readline the scripts seems to recover properly. Probably have to add some delay or timeout in exception handling to prevent excessive logging.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop/Server/Device (please complete the following information):
Additional context Add any other context about the problem here.
Logs Please set the Current Cost Custom Component's logging level to debug and provide relevant logs section from Home-Assistant. To Enable debug logging level, add this to your configuration.yaml and restart: