Add LNB polarity toggle (V-pol 13V / H-pol 18V)

Bridge: set_lnb_voltage(mode) wraps firmware lnbdc command, enable_lna()
now delegates to it. MCP: new set_lnb_voltage tool + 3 tests. TUI: Signal
screen button toggles between V-pol and H-pol instead of one-way LNA enable.
This commit is contained in:
Ryan Malloy 2026-02-17 17:24:05 -07:00
parent 8a6b99bd8c
commit f8bfd69ceb
5 changed files with 123 additions and 19 deletions

View file

@ -3,6 +3,7 @@
import pytest
from conftest import parse_result
from fastmcp import Client
from fastmcp.exceptions import ToolError
@pytest.mark.anyio
@ -42,6 +43,37 @@ async def test_enable_lna(mcp_client: Client):
data = parse_result(result)
assert data["status"] == "lna_enabled"
assert data["voltage"] == "13V"
assert data["polarity"] == "V"
@pytest.mark.anyio
async def test_set_lnb_voltage_odu(mcp_client: Client):
result = await mcp_client.call_tool(
"set_lnb_voltage", {"mode": "odu"}
)
data = parse_result(result)
assert data["voltage"] == "13V"
assert data["polarity"] == "V"
assert data["mode"] == "odu"
@pytest.mark.anyio
async def test_set_lnb_voltage_stb(mcp_client: Client):
result = await mcp_client.call_tool(
"set_lnb_voltage", {"mode": "stb"}
)
data = parse_result(result)
assert data["voltage"] == "18V"
assert data["polarity"] == "H"
assert data["mode"] == "stb"
@pytest.mark.anyio
async def test_set_lnb_voltage_invalid(mcp_client: Client):
with pytest.raises(ToolError):
await mcp_client.call_tool(
"set_lnb_voltage", {"mode": "invalid"}
)
@pytest.mark.anyio