diff --git a/pymammotion/data/model/device_config.py b/pymammotion/data/model/device_config.py index 99ebf92..879dc88 100644 --- a/pymammotion/data/model/device_config.py +++ b/pymammotion/data/model/device_config.py @@ -36,33 +36,28 @@ class OperationSettings(DataClassORJSONMixin): toward: int = 0 # is just angle toward_included_angle: int = 90 toward_mode: int = 0 # angle type relative etc - border_mode: int = 1 # border laps obstacle_laps: int = 1 - mowing_laps: int = 1 + mowing_laps: int = 1 # border laps start_progress: int = 0 areas: list[int] = field(default_factory=list) def create_path_order(operation_mode: OperationSettings, device_name: str) -> str: - i = 8 + # TODO add scheduling logic from getReserved() WorkSettingViewModel.java + i2 = 0 bArr = bytearray(8) - bArr[0] = operation_mode.border_mode + bArr[0] = operation_mode.mowing_laps bArr[1] = operation_mode.obstacle_laps bArr[3] = int(operation_mode.start_progress) bArr[2] = 0 - if not DeviceType.is_luba1(device_name): bArr[4] = 0 if DeviceType.is_yuka(device_name): - i = calculate_yuka_mode(operation_mode) - elif not DeviceType.is_luba_2(device_name): - i = 0 - bArr[5] = i - if operation_mode.is_dump: - b = int(operation_mode.collect_grass_frequency) + bArr[5] = calculate_yuka_mode(operation_mode) else: - b = 10 - bArr[6] = b + bArr[5] = 8 if DeviceType.is_luba_2(device_name) else 0 + + bArr[6] = int(operation_mode.collect_grass_frequency) if operation_mode.is_dump else 10 if DeviceType.is_luba1(device_name): bArr[4] = operation_mode.toward_mode return bArr.decode() diff --git a/pymammotion/data/model/mowing_modes.py b/pymammotion/data/model/mowing_modes.py index bf54431..86ca227 100644 --- a/pymammotion/data/model/mowing_modes.py +++ b/pymammotion/data/model/mowing_modes.py @@ -33,8 +33,8 @@ class ObstacleLapsMode(IntEnum): class MowOrder(IntEnum): """path_order""" - border_first = 0 - grid_first = 1 + grid_first = 0 + border_first = 1 class BypassStrategy(IntEnum): diff --git a/pymammotion/data/mqtt/event.py b/pymammotion/data/mqtt/event.py index bc741b7..26b1b6c 100644 --- a/pymammotion/data/mqtt/event.py +++ b/pymammotion/data/mqtt/event.py @@ -75,7 +75,7 @@ class DeviceBizReqEventValue(DataClassORJSONMixin): class GeneralParams(DataClassORJSONMixin): groupIdList: list[str] groupId: str - categoryKey: Literal["LawnMower"] + categoryKey: Literal["LawnMower", "Tracker"] batchId: str gmtCreate: int productKey: str diff --git a/pymammotion/mammotion/commands/mammotion_command.py b/pymammotion/mammotion/commands/mammotion_command.py index cc785af..87d14bf 100644 --- a/pymammotion/mammotion/commands/mammotion_command.py +++ b/pymammotion/mammotion/commands/mammotion_command.py @@ -42,11 +42,11 @@ def move_back(self, linear: float) -> bytes: def move_left(self, angular: float) -> bytes: """Move forward. values 0.0 1.0.""" angular_percent = get_percent(abs(angular * 100)) - (linear_speed, angular_speed) = transform_both_speeds(0.0, 0.0, 0.0, angular_percent) + (linear_speed, angular_speed) = transform_both_speeds(0.0, 180.0, 0.0, angular_percent) return self.send_movement(linear_speed=linear_speed, angular_speed=angular_speed) def move_right(self, angular: float) -> bytes: """Move back. values 0.0 1.0.""" angular_percent = get_percent(abs(angular * 100)) - (linear_speed, angular_speed) = transform_both_speeds(0.0, 180.0, 0.0, angular_percent) + (linear_speed, angular_speed) = transform_both_speeds(0.0, 0.0, 0.0, angular_percent) return self.send_movement(linear_speed=linear_speed, angular_speed=angular_speed) diff --git a/pyproject.toml b/pyproject.toml index 52a3574..87f971d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [project] name = "pymammotion" -version = "0.2.73" +version = "0.2.74" [tool.poetry] name = "pymammotion" -version = "0.2.73" +version = "0.2.74" license = "GNU-3.0" description = "" readme = "README.md" @@ -61,7 +61,7 @@ mypy = "^1.11.2" autotyping = "^24.3.0" [tool.bumpver] -current_version = "0.2.73" +current_version = "0.2.74" version_pattern = "MAJOR.MINOR.PATCH" commit_message = "Bump version {old_version} -> {new_version}" commit = true