Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions custom_components/robovac/vacuums/T2194.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class T2194(RobovacModelDetails):
},
RobovacCommand.RETURN_HOME: {
"code": 101,
"values": {"return": True},
},
RobovacCommand.FAN_SPEED: {
"code": 130,
Expand Down
13 changes: 13 additions & 0 deletions tests/test_vacuum/test_t2194_command_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading