roborock.devices.traits.v1.mop_dryer
Trait for the dock mop dryer.
1"""Trait for the dock mop dryer.""" 2 3from roborock.data import MopDryerSetting 4from roborock.device_features import RoborockDockFeatures 5from roborock.devices.traits.v1 import common 6from roborock.roborock_typing import RoborockCommand 7 8_STATUS_PARAM = "status" 9 10 11def _supports_mop_dryer(dock_features: RoborockDockFeatures) -> bool: 12 return dock_features.is_dryable 13 14 15class MopDryerTrait(MopDryerSetting, common.V1TraitMixin, common.RoborockSwitchBase): 16 """Trait for the dock mop dryer. 17 18 The switch controls the auto mop-drying setting, i.e. whether the dock 19 dries the mop after washing. ``start_dry`` and ``stop_dry`` control a 20 drying cycle directly. Whether a cycle is currently running is reported 21 as ``dry_status`` on the device status. 22 """ 23 24 command = RoborockCommand.APP_GET_DRYER_SETTING 25 converter = common.DefaultConverter(MopDryerSetting) 26 requires_dock_features = _supports_mop_dryer 27 28 @property 29 def is_on(self) -> bool: 30 """Return whether auto mop drying is enabled.""" 31 return self.status == 1 32 33 async def enable(self) -> None: 34 """Enable auto mop drying.""" 35 await self.rpc_channel.send_command(RoborockCommand.APP_SET_DRYER_SETTING, params={_STATUS_PARAM: 1}) 36 # Optimistic update to avoid an extra refresh 37 self.status = 1 38 39 async def disable(self) -> None: 40 """Disable auto mop drying.""" 41 await self.rpc_channel.send_command(RoborockCommand.APP_SET_DRYER_SETTING, params={_STATUS_PARAM: 0}) 42 # Optimistic update to avoid an extra refresh 43 self.status = 0 44 45 async def start_dry(self) -> None: 46 """Start a mop drying cycle.""" 47 await self.rpc_channel.send_command(RoborockCommand.APP_SET_DRYER_STATUS, params={_STATUS_PARAM: 1}) 48 49 async def stop_dry(self) -> None: 50 """Stop the running mop drying cycle.""" 51 await self.rpc_channel.send_command(RoborockCommand.APP_SET_DRYER_STATUS, params={_STATUS_PARAM: 0})
class
MopDryerTrait(roborock.data.v1.v1_containers.MopDryerSetting, roborock.devices.traits.v1.common.V1TraitMixin, roborock.devices.traits.v1.common.RoborockSwitchBase):
16class MopDryerTrait(MopDryerSetting, common.V1TraitMixin, common.RoborockSwitchBase): 17 """Trait for the dock mop dryer. 18 19 The switch controls the auto mop-drying setting, i.e. whether the dock 20 dries the mop after washing. ``start_dry`` and ``stop_dry`` control a 21 drying cycle directly. Whether a cycle is currently running is reported 22 as ``dry_status`` on the device status. 23 """ 24 25 command = RoborockCommand.APP_GET_DRYER_SETTING 26 converter = common.DefaultConverter(MopDryerSetting) 27 requires_dock_features = _supports_mop_dryer 28 29 @property 30 def is_on(self) -> bool: 31 """Return whether auto mop drying is enabled.""" 32 return self.status == 1 33 34 async def enable(self) -> None: 35 """Enable auto mop drying.""" 36 await self.rpc_channel.send_command(RoborockCommand.APP_SET_DRYER_SETTING, params={_STATUS_PARAM: 1}) 37 # Optimistic update to avoid an extra refresh 38 self.status = 1 39 40 async def disable(self) -> None: 41 """Disable auto mop drying.""" 42 await self.rpc_channel.send_command(RoborockCommand.APP_SET_DRYER_SETTING, params={_STATUS_PARAM: 0}) 43 # Optimistic update to avoid an extra refresh 44 self.status = 0 45 46 async def start_dry(self) -> None: 47 """Start a mop drying cycle.""" 48 await self.rpc_channel.send_command(RoborockCommand.APP_SET_DRYER_STATUS, params={_STATUS_PARAM: 1}) 49 50 async def stop_dry(self) -> None: 51 """Stop the running mop drying cycle.""" 52 await self.rpc_channel.send_command(RoborockCommand.APP_SET_DRYER_STATUS, params={_STATUS_PARAM: 0})
Trait for the dock mop dryer.
The switch controls the auto mop-drying setting, i.e. whether the dock
dries the mop after washing. start_dry and stop_dry control a
drying cycle directly. Whether a cycle is currently running is reported
as dry_status on the device status.
command =
<RoborockCommand.APP_GET_DRYER_SETTING: 'app_get_dryer_setting'>
The RoborockCommand used to fetch the trait data from the device (internal only).
converter =
DefaultConverter
The converter used to parse the response from the device (internal only).
is_on: bool
29 @property 30 def is_on(self) -> bool: 31 """Return whether auto mop drying is enabled.""" 32 return self.status == 1
Return whether auto mop drying is enabled.
async def
enable(self) -> None:
34 async def enable(self) -> None: 35 """Enable auto mop drying.""" 36 await self.rpc_channel.send_command(RoborockCommand.APP_SET_DRYER_SETTING, params={_STATUS_PARAM: 1}) 37 # Optimistic update to avoid an extra refresh 38 self.status = 1
Enable auto mop drying.
async def
disable(self) -> None:
40 async def disable(self) -> None: 41 """Disable auto mop drying.""" 42 await self.rpc_channel.send_command(RoborockCommand.APP_SET_DRYER_SETTING, params={_STATUS_PARAM: 0}) 43 # Optimistic update to avoid an extra refresh 44 self.status = 0
Disable auto mop drying.
async def
start_dry(self) -> None:
46 async def start_dry(self) -> None: 47 """Start a mop drying cycle.""" 48 await self.rpc_channel.send_command(RoborockCommand.APP_SET_DRYER_STATUS, params={_STATUS_PARAM: 1})
Start a mop drying cycle.