Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Tapo Hub H200 + D230 Doorbell stream #1543

Merged
merged 2 commits into from
Feb 17, 2025

Conversation

cavefire
Copy link
Contributor

@cavefire cavefire commented Jan 8, 2025

As stated in my issue #1174 streaming the D230 doorbell was not possible.

Running firmware versions:
H200: 1.3.6 Build 20240829 rel.71119
D230: 1.1.17 Build 20240731 rel.53511

This PR is implementing the fix suggested by @aprilmaccydee (as stated in #1174 (comment)). So all credits to them for figuring that out and sharing.

Using "io.Copy" reads the full body before discarding it, while "Body.Close()" only closes the body. I am not quite sure, why that makes a difference, but it does.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@SVilgelm
Copy link
Contributor

SVilgelm commented Jan 9, 2025

I am not quite sure, why that makes a difference, but it does.

Because it discards the leftovers in the network buffer. It is pretty common practice in go to use io.Copy and then close the body of a request

Co-authored-by: Sergey Vilgelm <523825+SVilgelm@users.noreply.github.com>
@AlexxIT AlexxIT self-assigned this Jan 9, 2025
@SVilgelm
Copy link
Contributor

SVilgelm commented Jan 9, 2025

it would be better to refactor all such cases instead of just this one, but can be done in separate PRs

@MS2620
Copy link

MS2620 commented Jan 22, 2025

I can vouch that this does indeed work, without adding this in my hub would not allow me to stream my camera, as soon as I added this in it immediately worked.

@AlexxIT AlexxIT merged commit ae3b535 into AlexxIT:master Feb 17, 2025
@AlexxIT
Copy link
Owner

AlexxIT commented Feb 17, 2025

Thanks!

@AlexxIT AlexxIT changed the title Fix H200 + D230 Doorbell stream Fix Tapo Hub H200 + D230 Doorbell stream Feb 18, 2025
@AlexxIT AlexxIT added this to the v1.9.9 milestone Feb 18, 2025
@AlexxIT
Copy link
Owner

AlexxIT commented Mar 10, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants