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 Disconnected Zone Bug #528

Merged
merged 1 commit into from
Nov 20, 2023
Merged

Fix Disconnected Zone Bug #528

merged 1 commit into from
Nov 20, 2023

Conversation

klay2000
Copy link
Contributor

This likely fixes #527

@codecov-commenter
Copy link

codecov-commenter commented Nov 10, 2023

Codecov Report

Attention: 1451 lines in your changes are missing coverage. Please review.

Comparison is base (17390bb) 56.25% compared to head (0ace166) 51.52%.
Report is 633 commits behind head on develop.

Files Patch % Lines
amplipi/display/tftdisplay.py 0.00% 407 Missing ⚠️
amplipi/streams.py 45.86% 275 Missing ⚠️
amplipi/display/epd2in13_V3.py 0.00% 230 Missing ⚠️
amplipi/display/einkdisplay.py 0.00% 124 Missing ⚠️
amplipi/eeprom.py 38.92% 91 Missing ⚠️
amplipi/ctrl.py 67.98% 81 Missing ⚠️
amplipi/mpris.py 37.62% 63 Missing ⚠️
amplipi/display/common.py 0.00% 53 Missing ⚠️
amplipi/display/display.py 0.00% 36 Missing ⚠️
amplipi/updater/asgi.py 0.00% 36 Missing ⚠️
... and 6 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #528      +/-   ##
===========================================
- Coverage    56.25%   51.52%   -4.73%     
===========================================
  Files           12       23      +11     
  Lines         2839     5624    +2785     
===========================================
+ Hits          1597     2898    +1301     
- Misses        1242     2726    +1484     
Flag Coverage Δ
unittests 51.52% <36.05%> (-4.73%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@linknum23
Copy link
Contributor

linknum23 commented Nov 16, 2023

Looking at this again. I think we need to fix the preamp code to handle a zone source of -1. Also that max() should be applied to all zone's sources I think.

@linknum23
Copy link
Contributor

linknum23 commented Nov 16, 2023

Here's what we need to do to fix this. Sorry if this is needlessly prescriptive

  • Add a test that sets zone sources to -1 and back
  • Add an assert in rt.py Mock update_zone_sources that checks if any of the sources are outside range(4)
  • Verify the test fails
  • Fix the code in set_zones to configure the source_ids sent to the rt within range(4) suggestion use source_id=0

v3 Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this file?

amplipi/ctrl.py Outdated
zones = self.status.zones
if update_source_id or force_update :
zone_sources = [zone.source_id for zone in zones]
zone_sources[idx] = max(sid, 0) # default disconnected zones to source 0
zone_sources = [utils.clamp(zone.source_id, 3, 0) for zone in zones]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
zone_sources = [utils.clamp(zone.source_id, 3, 0) for zone in zones]
zone_sources = [utils.clamp(zone.source_id, 0, 3) for zone in zones]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That doesn't change functionality, but matches the clamp signature

Copy link
Contributor

@linknum23 linknum23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, you may want to squash your commits after removing that weird file

@klay2000 klay2000 merged commit 798c7c4 into develop Nov 20, 2023
2 checks passed
@klay2000 klay2000 deleted the zone-disconnect-bugfix branch November 20, 2023 18:23
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.

None yet

3 participants