|
| 1 | +# mopidy-nad |
| 2 | + |
| 3 | +[](https://pypi.org/p/mopidy-nad) |
| 4 | +[](https://github.com/mopidy/mopidy-nad/actions/workflows/ci.yml) |
| 5 | +[](https://codecov.io/gh/mopidy/mopidy-nad) |
| 6 | + |
| 7 | +[Mopidy](https://mopidy.com) extension for controlling volume on a NAD amplifier. |
| 8 | +Developed and tested with a NAD C355BEE. |
| 9 | + |
| 10 | + |
| 11 | +## Maintainer wanted |
| 12 | + |
| 13 | +Mopidy-NAD is currently kept on life support by the Mopidy core developers. |
| 14 | +It is in need of a more dedicated maintainer. |
| 15 | + |
| 16 | +If you want to be the maintainer of Mopidy-NAD, please: |
| 17 | + |
| 18 | +1. Make 2-3 good pull requests improving any part of the project. |
| 19 | + |
| 20 | +2. Read and get familiar with all of the project's open issues. |
| 21 | + |
| 22 | +3. Send a pull request removing this section and adding yourself as the |
| 23 | + "Current maintainer" in the "Credits" section below. In the pull request |
| 24 | + description, please refer to the previous pull requests and state that |
| 25 | + you've familiarized yourself with the open issues. |
| 26 | + |
| 27 | +As a maintainer, you'll be given push access to the repo and the authority to |
| 28 | +make releases to PyPI when you see fit. |
| 29 | + |
| 30 | + |
| 31 | +## Installation |
| 32 | + |
| 33 | +Install by running: |
| 34 | + |
| 35 | +```sh |
| 36 | +python3 -m pip install mopidy-nad |
| 37 | +``` |
| 38 | + |
| 39 | +See https://mopidy.com/ext/nad/ for alternative installation methods. |
| 40 | + |
| 41 | + |
| 42 | +## Configuration |
| 43 | + |
| 44 | +The Mopidy-NAD extension is enabled by default. To disable it, add the |
| 45 | +following to `mopidy.conf`: |
| 46 | + |
| 47 | +```ini |
| 48 | +[nad] |
| 49 | +enabled = false |
| 50 | +``` |
| 51 | + |
| 52 | +The NAD amplifier must be connected to the machine running Mopidy using a |
| 53 | +serial cable. |
| 54 | + |
| 55 | +To use the NAD amplifier to control volume, set the `audio/mixer` config |
| 56 | +value in `mopidy.conf` to `nad`. You probably also needs to add some |
| 57 | +properties to the `nad` config section. |
| 58 | + |
| 59 | +Supported properties includes: |
| 60 | + |
| 61 | +- `port`: The serial device to use, defaults to `/dev/ttyUSB0`. This must |
| 62 | + be set correctly for the mixer to work. |
| 63 | + |
| 64 | +- `source`: The source that should be selected on the amplifier, like |
| 65 | + `aux`, `disc`, `tape`, `tuner`, etc. Leave unset if you don't want |
| 66 | + the mixer to change it for you. |
| 67 | + |
| 68 | +- `speakers-a`: Set to `on` or `off` (or `true` or `false`) if you |
| 69 | + want the mixer to make sure that speaker set A is turned on or off. Leave |
| 70 | + unset if you don't want the mixer to change it for you. |
| 71 | + |
| 72 | +- `speakers-b`: See `speakers-a`. |
| 73 | + |
| 74 | +Configuration example with minimum configuration, if the amplifier is available |
| 75 | +at `/dev/ttyUSB0`:: |
| 76 | + |
| 77 | +```ini |
| 78 | +[audio] |
| 79 | +mixer = nad |
| 80 | +``` |
| 81 | + |
| 82 | +Configuration example with minimum configuration, if the amplifier is available |
| 83 | +elsewhere: |
| 84 | + |
| 85 | +```ini |
| 86 | +[audio] |
| 87 | +mixer = nad |
| 88 | + |
| 89 | +[nad] |
| 90 | +port = /dev/ttyUSB3 |
| 91 | +``` |
| 92 | + |
| 93 | +Configuration example with full configuration:: |
| 94 | + |
| 95 | +```ini |
| 96 | +[audio] |
| 97 | +mixer = nad |
| 98 | + |
| 99 | +[nad] |
| 100 | +port = /dev/ttyUSB0 |
| 101 | +source = aux |
| 102 | +speakers-a = true |
| 103 | +speakers-b = false |
| 104 | +``` |
| 105 | + |
| 106 | + |
| 107 | +## Project resources |
| 108 | + |
| 109 | +- [Source code](https://github.com/mopidy/mopidy-nad) |
| 110 | +- [Issues](https://github.com/mopidy/mopidy-nad/issues) |
| 111 | +- [Releases](https://github.com/mopidy/mopidy-nad/releases) |
| 112 | + |
| 113 | + |
| 114 | +## Development |
| 115 | + |
| 116 | +### Set up development environment |
| 117 | + |
| 118 | +Clone the repo using, e.g. using [gh](https://cli.github.com/): |
| 119 | + |
| 120 | +```sh |
| 121 | +gh repo clone mopidy/mopidy-nad |
| 122 | +``` |
| 123 | + |
| 124 | +Enter the directory, and install dependencies using [uv](https://docs.astral.sh/uv/): |
| 125 | + |
| 126 | +```sh |
| 127 | +cd mopidy-nad/ |
| 128 | +uv sync |
| 129 | +``` |
| 130 | + |
| 131 | +### Running tests |
| 132 | + |
| 133 | +To run all tests and linters in isolated environments, use |
| 134 | +[tox](https://tox.wiki/): |
| 135 | + |
| 136 | +```sh |
| 137 | +tox |
| 138 | +``` |
| 139 | + |
| 140 | +To only run tests, use [pytest](https://pytest.org/): |
| 141 | + |
| 142 | +```sh |
| 143 | +pytest |
| 144 | +``` |
| 145 | + |
| 146 | +To format the code, use [ruff](https://docs.astral.sh/ruff/): |
| 147 | + |
| 148 | +```sh |
| 149 | +ruff format . |
| 150 | +``` |
| 151 | + |
| 152 | +To check for lints with ruff, run: |
| 153 | + |
| 154 | +```sh |
| 155 | +ruff check . |
| 156 | +``` |
| 157 | + |
| 158 | +To check for type errors, use [pyright](https://microsoft.github.io/pyright/): |
| 159 | + |
| 160 | +```sh |
| 161 | +pyright . |
| 162 | +``` |
| 163 | + |
| 164 | +### Making a release |
| 165 | + |
| 166 | +To make a release to PyPI, go to the project's [GitHub releases |
| 167 | +page](https://github.com/mopidy/mopidy-nad/releases) |
| 168 | +and click the "Draft a new release" button. |
| 169 | + |
| 170 | +In the "choose a tag" dropdown, select the tag you want to release or create a |
| 171 | +new tag, e.g. `v0.1.0`. Add a title, e.g. `v0.1.0`, and a description of the changes. |
| 172 | + |
| 173 | +Decide if the release is a pre-release (alpha, beta, or release candidate) or |
| 174 | +should be marked as the latest release, and click "Publish release". |
| 175 | + |
| 176 | +Once the release is created, the `release.yml` GitHub Action will automatically |
| 177 | +build and publish the release to |
| 178 | +[PyPI](https://pypi.org/project/mopidy-nad/). |
| 179 | + |
| 180 | + |
| 181 | +## Credits |
| 182 | + |
| 183 | +- Original author: [Stein Magnus Jodal](https://github.com/jodal) |
| 184 | +- Current maintainer: None. Maintainer wanted, see section above. |
| 185 | +- [Contributors](https://github.com/mopidy/mopidy-nad/graphs/contributors) |
0 commit comments