-
-
Notifications
You must be signed in to change notification settings - Fork 30
Volume Delta Expansion #1062
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
Open
SteveMicroNova
wants to merge
16
commits into
main
Choose a base branch
from
VolumeDeltaExpansion
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Volume Delta Expansion #1062
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
c09b835
Add vol_f_buffer
SteveMicroNova db4230f
Reactivate /api calls, add instant polling to all mute changes
SteveMicroNova 476a2b3
Swap "buffer" verbiage to "overflow"
SteveMicroNova ff39bbe
Reconfigure check to be not as confusing to read
SteveMicroNova 51839c7
Improve variable names, documentation
SteveMicroNova 83410d9
Don't always reset overflow to zero immediately by changing "or" to "…
SteveMicroNova 9f363ca
Fix some documentation oddities
SteveMicroNova 29ca099
Update changelog, add test
SteveMicroNova e2fd55c
Update tests instead
SteveMicroNova 07741f8
spellcheck
SteveMicroNova cbceb03
Add test for excessively large overflows
SteveMicroNova 6a05ee2
Fix for review feedback
SteveMicroNova f92f5c5
Lint
SteveMicroNova a177f3e
Remove jitter from volume setting
SteveMicroNova ecfe1ba
Explain why the response is not consumed on delta change in CardVolum…
SteveMicroNova 181926b
Update CHANGELOG.md
SteveMicroNova File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -605,20 +605,44 @@ def test_patch_zones_vol_delta(client): | |
| # check that each update worked as expected | ||
| for z in jrv['zones']: | ||
| if z['id'] in range(6): | ||
| assert z['vol_f'] - (zones[z['id']]['vol_f'] + 0.1) < 0.0001 | ||
| assert z['vol_f'] - (zones[z['id']]['vol_f'] + 0.1) < 0.0001 and z["vol_f_overflow"] == 0 | ||
|
|
||
| # test oversized deltas | ||
| rv = client.patch('/api/zones', json={'zones': [z['id'] for z in zones], 'update': {'vol_delta_f': -10.0}}) | ||
| # test overflowing deltas | ||
| rv = client.patch('/api/zones', json={'zones': [z['id'] for z in zones], 'update': {'vol_delta_f': -1.0}}) | ||
| assert rv.status_code == HTTPStatus.OK | ||
| jrv = rv.json() | ||
| assert len(jrv['zones']) >= 6 | ||
| # check that each update worked as expected | ||
| for z in jrv['zones']: | ||
| if z['id'] in range(6): | ||
| assert z['vol_f'] == amplipi.models.MIN_VOL_F | ||
| assert z["vol_f_overflow"] == zones[z['id']]['vol_f'] + 0.1 - 1 | ||
|
|
||
| # test oversized overflowing deltas | ||
| rv = client.patch('/api/zones', json={'zones': [z['id'] for z in zones], 'update': {'vol_delta_f': 10.0}}) | ||
| assert rv.status_code == HTTPStatus.OK | ||
| jrv = rv.json() | ||
| assert len(jrv['zones']) >= 6 | ||
| # check that each update worked as expected | ||
| for z in jrv['zones']: | ||
| if z['id'] in range(6): | ||
| assert z['vol_f'] == amplipi.models.MAX_VOL_F | ||
| assert z["vol_f_overflow"] == amplipi.models.MAX_VOL_F_OVERFLOW | ||
|
|
||
| # test overflow reset | ||
| mid_vol_f = (amplipi.models.MIN_VOL_F + amplipi.models.MAX_VOL_F) / 2 | ||
| rv = client.patch('/api/zones', json={'zones': [z['id'] for z in zones], 'update': {'vol_f': mid_vol_f}}) | ||
| assert rv.status_code == HTTPStatus.OK | ||
| jrv = rv.json() | ||
| assert len(jrv['zones']) >= 6 | ||
| # check that each update worked as expected | ||
| for z in jrv['zones']: | ||
| if z['id'] in range(6): | ||
| assert z['vol_f'] == mid_vol_f | ||
| assert z["vol_f_overflow"] == 0 | ||
|
Comment on lines
+608
to
+642
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changed this test to account for valid overflows, oversized overflows, and overflow resets |
||
|
|
||
| # test precedence | ||
| rv = client.patch('/api/zones', json={'zones': [z['id'] for z in zones], 'update': {'vol_delta_f': 10.0, "vol": amplipi.models.MIN_VOL_DB}}) | ||
| rv = client.patch('/api/zones', json={'zones': [z['id'] for z in zones], 'update': {'vol_delta_f': 1.0, "vol": amplipi.models.MIN_VOL_DB}}) | ||
| assert rv.status_code == HTTPStatus.OK | ||
| jrv = rv.json() | ||
| assert len(jrv['zones']) >= 6 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.