|
@@ -127,6 +127,7 @@ class SwitchbotBaseDevice:
|
|
|
|
|
|
_turn_on_command: str | None = None
|
|
_turn_on_command: str | None = None
|
|
_turn_off_command: str | None = None
|
|
_turn_off_command: str | None = None
|
|
|
|
+ _press_command: str | None = None
|
|
|
|
|
|
def __init__(
|
|
def __init__(
|
|
self,
|
|
self,
|
|
@@ -718,6 +719,13 @@ class SwitchbotBaseDevice:
|
|
result = await self._send_command(self._turn_off_command)
|
|
result = await self._send_command(self._turn_off_command)
|
|
return self._check_command_result(result, 0, {1})
|
|
return self._check_command_result(result, 0, {1})
|
|
|
|
|
|
|
|
+ @update_after_operation
|
|
|
|
+ async def press(self) -> bool:
|
|
|
|
+ """Press the device."""
|
|
|
|
+ self._check_function_support(self._press_command)
|
|
|
|
+ result = await self._send_command(self._press_command)
|
|
|
|
+ return self._check_command_result(result, 0, {1})
|
|
|
|
+
|
|
|
|
|
|
class SwitchbotDevice(SwitchbotBaseDevice):
|
|
class SwitchbotDevice(SwitchbotBaseDevice):
|
|
"""
|
|
"""
|