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

Ensure HTTP 200 status is sent when get_characteristics has no failures #337

Merged
merged 1 commit into from
Mar 28, 2021

Conversation

bdraco
Copy link
Contributor

@bdraco bdraco commented Mar 23, 2021

Previously we always sent a multi-status of 207 even when
there were no failures. HomeKit expects a HTTP 200 response
when there are no failures, and for status to be not
be set in the 100% success state.

This change drastically reduces the amount of polling that
the iOS device does because it no longer schedules a retry
based on the unexpected 207 which translates into a meaningful
improvement in battery life.

@codecov
Copy link

codecov bot commented Mar 23, 2021

Codecov Report

Merging #337 (372dbf4) into dev (dae7650) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev     #337      +/-   ##
==========================================
+ Coverage   90.57%   90.60%   +0.02%     
==========================================
  Files          19       19              
  Lines        1889     1894       +5     
  Branches      217      220       +3     
==========================================
+ Hits         1711     1716       +5     
  Misses        134      134              
  Partials       44       44              
Impacted Files Coverage Δ
pyhap/accessory_driver.py 89.44% <100.00%> (-0.04%) ⬇️
pyhap/const.py 100.00% <100.00%> (ø)
pyhap/hap_handler.py 81.23% <100.00%> (-0.37%) ⬇️

@bdraco bdraco force-pushed the fix_http_code_get_success branch 2 times, most recently from 9e1a8ec to 6909c16 Compare March 23, 2021 23:45
Previously we always sent a multi-status of 207 even when
there were no failures. HomeKit expects a HTTP 200 response
when there are no failures, and for status to be not
be set in the 100% success state.
@bdraco bdraco marked this pull request as ready for review March 24, 2021 00:13
@bdraco
Copy link
Contributor Author

bdraco commented Mar 26, 2021

@ikalchev Can we get a release with this one when you have a free moment?

@ikalchev
Copy link
Owner

Sure, will merge and release tomorrow.

@bdraco
Copy link
Contributor Author

bdraco commented Mar 27, 2021

Thank you 🙏🏻

@ikalchev ikalchev merged commit bdd3813 into ikalchev:dev Mar 28, 2021
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.

2 participants