Drop the brightness control, survive and explain a frozen mic
- Remove RGB brightness: firmware 2.1.2 stores the value but the LEDs never change, so the control did nothing. PROTOCOL.md notes why. - Lock the device per transaction (flock) so the CLI and the web service can't interleave and steal each other's replies. - Detect a mic that is plugged in but no longer answering and tell the user to replug it (a USB reset is not enough; settings survive). Seen when hardware buttons are held while settings are being written. - Web page keeps the last known value when a poll comes back partial, instead of drawing unanswered settings as off. - New screenshot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -60,5 +60,21 @@ class Encoding(unittest.TestCase):
|
||||
encode("volume", 3)
|
||||
|
||||
|
||||
|
||||
class NotRespondingDetection(unittest.TestCase):
|
||||
def test_all_unanswered_reads_raise(self):
|
||||
from dgm20.device import Mic, NotResponding
|
||||
mic = Mic.__new__(Mic) # no device needed: reads always time out
|
||||
mic.read = lambda addr: None
|
||||
with self.assertRaises(NotResponding):
|
||||
mic.state()
|
||||
|
||||
def test_partial_answers_are_fine(self):
|
||||
from dgm20.device import Mic
|
||||
mic = Mic.__new__(Mic)
|
||||
mic.read = lambda addr: 1 if addr == 0x2022 else None
|
||||
self.assertTrue(mic.state()["mute"])
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user