AmpliPi
AmpliPi copied to clipboard
Disconnect zones from source when stream disconnects
What does this change intend to accomplish?
Disconnects zones from source when stream disconnects from the same source. This is useful because leaving zones and groups secretly connected in the background had some potential conflicts with home assistant automations
Checklist
- [x] Have you tested your changes and ensured they work?
- [x] Have you checked to ensure there aren't other open Pull Requests for the same update/change?
- [ ] If applicable, have you updated the CHANGELOG?
- [ ] Does your submission pass linting & tests? You can test on localhost using
./scripts/test - [ ] Have you written new tests for your core features/changes, as applicable?
Can this just be implemented on the HA side for now?
Yes, but that leaves room for errors when a user clicks the X to close out a stream on the AmpliPi webapp. That particular React component doesn't have enough state to call after the zones to disconnect them along the way, and it seemed better to implement in the backend rather than doing it across two different codebases