Split media vs emit volume for radio and widget

This commit is contained in:
Jage9
2026-02-21 22:38:48 -05:00
parent bb36a007e2
commit a2c1306b46
10 changed files with 72 additions and 24 deletions

View File

@@ -132,6 +132,13 @@ async def test_radio_channel_update_validates(monkeypatch: pytest.MonkeyPatch) -
assert send_payloads[-1].ok is False
assert "facing must be between 0 and 360" in send_payloads[-1].message.lower()
await server._handle_message(
client,
json.dumps({"type": "item_update", "itemId": item.id, "params": {"mediaVolume": 12}}),
)
assert send_payloads[-1].ok is True
assert item.params.get("mediaVolume") == 12
await server._handle_message(
client,
json.dumps({"type": "item_update", "itemId": item.id, "params": {"emitRange": 12}}),
@@ -277,6 +284,7 @@ async def test_widget_update_and_use(monkeypatch: pytest.MonkeyPatch) -> None:
"directional": True,
"facing": 123.4,
"emitRange": 7,
"emitVolume": 42,
"useSound": "ping.ogg",
"emitSound": "https://example.com/ambient.ogg",
},
@@ -287,6 +295,7 @@ async def test_widget_update_and_use(monkeypatch: pytest.MonkeyPatch) -> None:
assert item.params.get("directional") is True
assert item.params.get("facing") == 123.4
assert item.params.get("emitRange") == 7
assert item.params.get("emitVolume") == 42
assert item.params.get("useSound") == "sounds/ping.ogg"
assert item.params.get("emitSound") == "https://example.com/ambient.ogg"