Add MX-T40 BLE desktop controller and protocol documentation
Checks / tests (ubuntu-latest, 3.11) (push) Canceled after 0s
Checks / tests (ubuntu-latest, 3.14) (push) Canceled after 0s
Checks / tests (windows-latest, 3.11) (push) Canceled after 0s
Checks / tests (windows-latest, 3.14) (push) Canceled after 0s
Checks / package (push) Canceled after 0s

This commit is contained in:
lda committed 2026-10-25 04:43:47 +07:00 Verified
commit 038e152bbc
38 files changed
+2344

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
"""Match semantic command builders against independently captured writes."""
import unittest
from controller import commands
from controller.protocol import Encoder
class CommandTests(unittest.TestCase):
def test_rock_packet_matches_hardware_capture(self):
encoder = Encoder()
encoder.sequence = 11
self.assertEqual(
encoder.encode(commands.set_eq(5)), bytes.fromhex("00 bb 01 0c 00 05 40 03 00 05 00 5a")
)
def test_bass_off_matches_hardware_capture(self):
encoder = Encoder()
encoder.sequence = 6
self.assertEqual(
encoder.encode(commands.set_bass(False)),
bytes.fromhex("00 bb 01 07 00 05 40 04 00 01 00 52"),
)
def test_invalid_rgb_is_rejected_before_transport(self):
with self.assertRaises(ValueError):
commands.set_rgb(256, 0, 0)
with self.assertRaises(ValueError):
commands.set_rgb(0.5, 0, 0)