minor otg hid fixes

This commit is contained in:
Devaev Maxim 2019-09-30 01:02:00 +03:00
parent 7d6d6fa6f9
commit e1b7e4fbcd

View File

@ -88,7 +88,7 @@ class DeviceProcess(multiprocessing.Process): # pylint: disable=too-many-instan
self._process_event(event) self._process_event(event)
passed = 0 passed = 0
except Exception: except Exception:
logger.error("Unexpected HID-%s error", self.__name) logger.exception("Unexpected HID-%s error", self.__name)
self._close_device() self._close_device()
finally: finally:
time.sleep(1) time.sleep(1)
@ -96,7 +96,7 @@ class DeviceProcess(multiprocessing.Process): # pylint: disable=too-many-instan
self._close_device() self._close_device()
def is_online(self) -> bool: def is_online(self) -> bool:
return bool(self.__online_shared.value) return bool(self.__online_shared.value and self.is_alive())
def _stop(self) -> None: def _stop(self) -> None:
if self.is_alive(): if self.is_alive():