Fix camera not merging packets (#63)

This commit is contained in:
Otto Winter 2021-07-09 09:19:39 +02:00 committed by GitHub
parent 1696b88b64
commit 33e49a19b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -274,7 +274,8 @@ class APIClient:
if isinstance(msg, CameraImageResponse):
data = image_stream.pop(msg.key, bytes()) + msg.data
if msg.done:
on_state(CameraState.from_pb(msg))
# Return CameraState with the merged data
on_state(CameraState(key=msg.key, data=data))
else:
image_stream[msg.key] = data
return