Skip to content

Commit

Permalink
Fix doc building, format and fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
HEnquist committed Sep 4, 2024
1 parent 392f871 commit ffa9a4f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
12 changes: 6 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ This class handles the communication over websocket with the CamillaDSP process.

The various commands are grouped on helper classes that are instantiated
by the CamillaClient class.
For example volume controls are handled by the `Volume` class.
For example volume and mute controls are handled by the `Volume` class.
These methods are accessible via the `volume` property of the CamillaClient.
Reading the main volume is then done by calling `my_client.volume.main()`.
Reading the main volume is then done by calling `my_client.volume.main_volume()`.

Methods for reading a value are named the same as the name of the value,
while methods for writing have a `set_` prefix.
For example the method for reading the main volume is called `main`,
and the method for changing the main volume is called `set_main`.
For example the method for reading the main volume is called `main_volume`,
and the method for changing the main volume is called `set_main_volume`.

Example:
```py
client = CamillaClient("localhost", 1234)
client.connect()

volume = client.volume.main()
mute = client.mute.main()
volume = client.volume.main_volume()
mute = client.volume.main_mute()
state = client.general.state()
capture_levels = client.levels.capture_rms()
```
Expand Down
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ theme:

plugins:
- mkdocstrings
- autorefs:
resolve_closest: true

nav:
- index.md
Expand Down
20 changes: 12 additions & 8 deletions tests/test_camillaws.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ def test_connect(camilla_mockws):
assert camilla_mockws.is_connected()
assert camilla_mockws.general.state() == camilladsp.ProcessingState.INACTIVE
assert camilla_mockws.versions.camilladsp() == ("0", "3", "2")
assert camilla_mockws.versions.library() == tuple(
camilladsp.VERSION.split(".")
)
assert camilla_mockws.versions.library() == tuple(camilladsp.VERSION.split("."))
camilla_mockws.disconnect()
assert not camilla_mockws.is_connected()

Expand Down Expand Up @@ -323,14 +321,20 @@ def test_queries_adv(camilla_mockquery_yaml):
camilla_mockquery_yaml.config.previous()
camilla_mockquery_yaml.query.assert_called_with("GetPreviousConfig")


def test_queries_customreplies(camilla_mockquery):
camilla_mockquery.query.return_value = [0, -12.0]
camilla_mockquery.query.return_value = [0, -12.0]
camilla_mockquery.volume.adjust_volume(0, -5.0)
camilla_mockquery.query.assert_called_with("AdjustFaderVolume", arg=(0, -5.0))
camilla_mockquery.volume.adjust_volume(0, -5.0, min_limit=-20, max_limit=3.0)
camilla_mockquery.query.assert_called_with("AdjustFaderVolume", arg=(0, (-5.0, -20.0, 3.0)))
camilla_mockquery.query.assert_called_with(
"AdjustFaderVolume", arg=(0, (-5.0, -20.0, 3.0))
)
camilla_mockquery.volume.adjust_volume(0, -5.0, min_limit=-20)
camilla_mockquery.query.assert_called_with("AdjustFaderVolume", arg=(0, (-5.0, -20.0, 50.0)))
camilla_mockquery.query.assert_called_with(
"AdjustFaderVolume", arg=(0, (-5.0, -20.0, 50.0))
)
camilla_mockquery.volume.adjust_volume(0, -5.0, max_limit=3.0)
camilla_mockquery.query.assert_called_with("AdjustFaderVolume", arg=(0, (-5.0, -150.0, 3.0)))

camilla_mockquery.query.assert_called_with(
"AdjustFaderVolume", arg=(0, (-5.0, -150.0, 3.0))
)

0 comments on commit ffa9a4f

Please sign in to comment.