diff --git a/pyneato/enum.py b/pyneato/enum.py index 1ded156..4d49961 100644 --- a/pyneato/enum.py +++ b/pyneato/enum.py @@ -7,6 +7,7 @@ class RobotAbilityEnum(str, Enum): class RobotStateEnum(Enum): BUSY = 'busy' IDLE = 'idle' + PAUSED = 'paused' @staticmethod def from_str(state: str): @@ -14,6 +15,8 @@ def from_str(state: str): return RobotStateEnum.BUSY elif state == 'idle': return RobotStateEnum.IDLE + elif state == 'paused': + return RobotStateEnum.PAUSED else: raise NotImplementedError('RobotState %s'%state) diff --git a/pyneato/robot.py b/pyneato/robot.py index 9279918..cfb0088 100644 --- a/pyneato/robot.py +++ b/pyneato/robot.py @@ -249,7 +249,7 @@ def _base_message(self, message: str, schema: Schema): def pause_cleaning(self) -> bool: result = self._base_message("cleaning.pause", ABILITY_SCHEMA) - return result.success + return result["success"] def get_state(self) -> RobotState: result = self._base_message(RobotAbilityEnum.STATE_SHOW.value, STATE_SCHEMA) @@ -294,16 +294,18 @@ def info_robot(self): def resume_cleaning(self) -> bool: result = self._base_message("cleaning.resume", ABILITY_SCHEMA) - return result.success + return result["success"] def cancel_cleaning(self) -> bool: pause_result = self.pause_cleaning() return_to_base_result = self.return_to_base() - return pause_result.success and return_to_base_result.success + return pause_result and return_to_base_result - def return_to_base(self): - return self._base_message("navigation.return_to_base", ABILITY_SCHEMA) + def return_to_base(self) -> bool: + result = self._base_message("navigation.return_to_base", ABILITY_SCHEMA) + + return result["success"] @property def state(self): diff --git a/pyproject.toml b/pyproject.toml index ca4741d..c2fd1be 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "pyneato" -version = "0.0.2" +version = "0.0.3" authors = [ { name="Benjamin Paap", email="benjamin.paap@gmail.com" }, ]