From d374e9eec3f89fe5bea65bb68b8b2ac79f6f9128 Mon Sep 17 00:00:00 2001 From: Gargee Sharma Date: Wed, 9 Sep 2026 22:25:02 +0530 Subject: [PATCH 1/2] fix(code_mappings): map codes 112 and 113 for B01_Q10_DP --- roborock/data/b01_q10/b01_q10_code_mappings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/roborock/data/b01_q10/b01_q10_code_mappings.py b/roborock/data/b01_q10/b01_q10_code_mappings.py index 203df3f2..e3e5a836 100644 --- a/roborock/data/b01_q10/b01_q10_code_mappings.py +++ b/roborock/data/b01_q10/b01_q10_code_mappings.py @@ -108,6 +108,8 @@ class B01_Q10_DP(RoborockModeEnum): # yet known. They are intentionally left unmapped; ``decode_rpc_response`` # silently ignores unknown codes via ``from_code_optional``, so they do not # produce "not a valid code" warnings. Map them here once identified. + UNKNOWN_112 = ("dpUnknown112", 112) + UNKNOWN_113 = ("dpUnknown113", 113) STATUS = ("dpStatus", 121) BATTERY = ("dpBattery", 122) FAN_LEVEL = ("dpFanLevel", 123) # NOTE: typo "dpfunLevel" in source code From 86011b54e242cb8ed1a70f7a07e7e3cb2e35d49f Mon Sep 17 00:00:00 2001 From: Gargee Sharma Date: Thu, 10 Sep 2026 20:58:18 +0530 Subject: [PATCH 2/2] test: update test expectations for mapped B01_Q10_DP codes 112 and 113 --- tests/data/test_code_mappings.py | 4 ++-- tests/protocols/test_b01_q10_protocol.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/data/test_code_mappings.py b/tests/data/test_code_mappings.py index 735d87ac..e5d19975 100644 --- a/tests/data/test_code_mappings.py +++ b/tests/data/test_code_mappings.py @@ -45,8 +45,8 @@ def test_from_code_optional_does_not_warn(caplog: pytest.LogCaptureFixture) -> N completed_warnings.discard("112 is not a valid code for B01_Q10_DP") completed_warnings.discard("113 is not a valid code for B01_Q10_DP") with caplog.at_level(logging.WARNING): - assert B01_Q10_DP.from_code_optional(112) is None - assert B01_Q10_DP.from_code_optional(113) is None + assert B01_Q10_DP.from_code_optional(112) == B01_Q10_DP.UNKNOWN_112 + assert B01_Q10_DP.from_code_optional(113) == B01_Q10_DP.UNKNOWN_113 assert "not a valid code" not in caplog.text diff --git a/tests/protocols/test_b01_q10_protocol.py b/tests/protocols/test_b01_q10_protocol.py index 5fddc41a..ed44be5c 100644 --- a/tests/protocols/test_b01_q10_protocol.py +++ b/tests/protocols/test_b01_q10_protocol.py @@ -161,6 +161,8 @@ def test_decode_unknown_dps_code(caplog: pytest.LogCaptureFixture) -> None: decoded_message = decode_rpc_response(message) assert decoded_message == { B01_Q10_DP.BATTERY: 100, + B01_Q10_DP.UNKNOWN_112: 0, + B01_Q10_DP.UNKNOWN_113: 0, } assert "not a valid code" not in caplog.text