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

Reduce payload sizes by adding support for short UUIDs and compact json #345

Merged
merged 4 commits into from
May 30, 2021

Conversation

bdraco
Copy link
Contributor

@bdraco bdraco commented May 25, 2021

/accessories payloads sizes are now reduced by ~40%+ with:

  • Apple defined uuids should be reduced to their short form to reduce the payloads

  • description (optional) is only included in the payload if it has been customized

  • compact json

  • fixes events not being utf-8 encoded

This solved another case of iOS getting stuck updating when the bridge has many devices

@codecov
Copy link

codecov bot commented May 25, 2021

Codecov Report

Merging #345 (dbdf810) into dev (ac90099) will increase coverage by 0.14%.
The diff coverage is 98.73%.

@@            Coverage Diff             @@
##              dev     #345      +/-   ##
==========================================
+ Coverage   90.66%   90.81%   +0.14%     
==========================================
  Files          19       19              
  Lines        1897     1917      +20     
  Branches      220      224       +4     
==========================================
+ Hits         1720     1741      +21     
  Misses        133      133              
+ Partials       44       43       -1     
Impacted Files Coverage Δ
pyhap/accessory_driver.py 89.79% <50.00%> (-0.03%) ⬇️
pyhap/characteristic.py 100.00% <100.00%> (ø)
pyhap/const.py 100.00% <100.00%> (ø)
pyhap/hap_handler.py 81.17% <100.00%> (-0.06%) ⬇️
pyhap/loader.py 100.00% <100.00%> (ø)
pyhap/service.py 100.00% <100.00%> (+1.85%) ⬆️
pyhap/util.py 100.00% <100.00%> (ø)

Apple defined uuids should be reduced to their
short form to reduce the payloads
@bdraco
Copy link
Contributor Author

bdraco commented May 25, 2021

This does quite a bit to reduce payload sizes and improve performance since the encrypted payloads are much smaller.

@bdraco bdraco marked this pull request as ready for review May 25, 2021 08:51
@bdraco
Copy link
Contributor Author

bdraco commented May 25, 2021

@ikalchev Can we get a release with this for this week's Home Assistant beta?

Thanks!

@bdraco bdraco force-pushed the short_uuids branch 2 times, most recently from 668205d to a19f4ce Compare May 25, 2021 10:09
@bdraco bdraco changed the title Add support for short UUIDs Reduce payload sizes by add supporting for short UUIDs and compact json May 25, 2021
@bdraco bdraco changed the title Reduce payload sizes by add supporting for short UUIDs and compact json Reduce payload sizes by add support for short UUIDs and compact json May 25, 2021
@bdraco bdraco changed the title Reduce payload sizes by add support for short UUIDs and compact json Reduce payload sizes by adding support for short UUIDs and compact json May 25, 2021
@ikalchev ikalchev merged commit 6eeb8ef into ikalchev:dev May 30, 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