From 76e75b9fa067c3490cb1fa36e3f7c1709fdc6c8d Mon Sep 17 00:00:00 2001 From: o8uzhan Date: Sat, 25 Jul 2026 14:41:41 +0300 Subject: [PATCH] fix(T2194): add missing values mapping for RETURN_HOME command RETURN_HOME command for L35 Hybrid (T2194) had no 'values' mapping, causing getRoboVacCommandValue() to fall back to sending the raw string 'return' to a DPS code (101) that the device expects as a boolean. This caused the vacuum to start cleaning instead of returning to dock when 'Return to Dock' was pressed. Confirmed via debug logs on real hardware: DPS 101 is reported as a bool in every status update from the device. Added a regression test verifying getRoboVacCommandValue() maps 'return' to True for this model. --- custom_components/robovac/vacuums/T2194.py | 1 + tests/test_vacuum/test_t2194_command_mappings.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/custom_components/robovac/vacuums/T2194.py b/custom_components/robovac/vacuums/T2194.py index 442534c5..add71e0c 100644 --- a/custom_components/robovac/vacuums/T2194.py +++ b/custom_components/robovac/vacuums/T2194.py @@ -65,6 +65,7 @@ class T2194(RobovacModelDetails): }, RobovacCommand.RETURN_HOME: { "code": 101, + "values": {"return": True}, }, RobovacCommand.FAN_SPEED: { "code": 130, diff --git a/tests/test_vacuum/test_t2194_command_mappings.py b/tests/test_vacuum/test_t2194_command_mappings.py index f72ddb1f..75f367ef 100644 --- a/tests/test_vacuum/test_t2194_command_mappings.py +++ b/tests/test_vacuum/test_t2194_command_mappings.py @@ -85,3 +85,16 @@ def test_t2194_model_has_commands(mock_t2194_robovac) -> None: assert RobovacCommand.LOCATE in commands assert RobovacCommand.BATTERY in commands assert RobovacCommand.ERROR in commands + + +def test_t2194_return_home_value(mock_t2194_robovac) -> None: + """Test T2194 RETURN_HOME maps 'return' to boolean True. + + RETURN_HOME had no 'values' mapping, so getRoboVacCommandValue() + fell back to returning the raw string "return" instead of the + boolean the device expects on DPS code 101 (confirmed via debug + logs showing DPS 101 reported as a bool in every status update). + This caused the vacuum to start cleaning instead of returning to + dock when 'Return to Dock' was pressed in Home Assistant. + """ + assert mock_t2194_robovac.getRoboVacCommandValue(RobovacCommand.RETURN_HOME, "return") is True