Skip to content

Commit

Permalink
[fix] vacuum cleaner send command
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutsuku committed Jun 30, 2021
1 parent e50d830 commit 4515ba0
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions custom_components/tuya_v2/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,7 @@ def start(self, **kwargs: Any) -> None:
"""Turn the device on."""
_LOGGER.debug(f"Starting {self.name}")

self.tuya_device_manager.sendCommands(
self.tuya_device.id, [{"code": DPCODE_POWER_GO, "value": True}]
)
self._send_command([{"code": DPCODE_POWER_GO, "value": True}])

# Turn off/pause/stop all do the same thing

Expand All @@ -176,16 +174,12 @@ def start(self, **kwargs: Any) -> None:
def stop(self, **kwargs: Any) -> None:
"""Turn the device off."""
_LOGGER.debug(f"Stopping {self.name}")
self.tuya_device_manager.sendCommands(
self.tuya_device.id, [{"code": DPCODE_POWER_GO, "value": False}]
)
self._send_command([{"code": DPCODE_POWER_GO, "value": False}])

def pause(self, **kwargs: Any) -> None:
"""Pause the device."""
_LOGGER.debug(f"Pausing {self.name}")
self.tuya_device_manager.sendCommands(
self.tuya_device.id, [{"code": DPCODE_PAUSE, "value": True}]
)
self._send_command([{"code": DPCODE_PAUSE, "value": True}])

# def start_pause(self, **kwargs: Any) -> None:
# """Start/Pause the device"""
Expand All @@ -199,6 +193,4 @@ def pause(self, **kwargs: Any) -> None:
def return_to_base(self, **kwargs: Any) -> None:
"""Return device to Dock"""
_LOGGER.debug(f"Return to base device {self.name}")
self.tuya_device_manager.sendCommands(
self.tuya_device.id, [{"code": DPCODE_MODE, "value": "chargego"}]
)
self._send_command([{"code": DPCODE_MODE, "value": "chargego"}])

0 comments on commit 4515ba0

Please sign in to comment.