M8-R05: recover WarmteLink ingestion and discovery automatically
This commit is contained in:
@@ -177,7 +177,6 @@ class WarmteLinkWorker:
|
||||
|
||||
def _run(self) -> None:
|
||||
backoff_index = 0
|
||||
framer = TelegramFramer()
|
||||
while not self._stop_event.is_set():
|
||||
try:
|
||||
device = self._serial_factory(self.config)
|
||||
@@ -187,6 +186,11 @@ class WarmteLinkWorker:
|
||||
device.close()
|
||||
return
|
||||
self._serial = device
|
||||
# A disconnect makes any bytes buffered from the previous
|
||||
# descriptor untrustworthy. In particular, never let a
|
||||
# trailing partial telegram be completed by a newly opened
|
||||
# device.
|
||||
framer = TelegramFramer()
|
||||
while not self._stop_event.is_set():
|
||||
self._expire_discoveries()
|
||||
chunk = device.read(1024)
|
||||
|
||||
Reference in New Issue
Block a user