File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -27,16 +27,16 @@ class DoNotDisturbTrait(Trait):
2727
2828 def __init__ (self , rpc_channel : Callable [[], V1RpcChannel ]) -> None :
2929 """Initialize the DoNotDisturbTrait."""
30- self ._rpc_channel = rpc_channel
30+ self ._send_command = lambda * args , ** kwargs : rpc_channel (). send_command ( * args , ** kwargs )
3131
3232 async def get_dnd_timer (self ) -> DnDTimer :
3333 """Get the current Do Not Disturb (DND) timer settings of the device."""
34- return await self ._rpc_channel (). send_command (RoborockCommand .GET_DND_TIMER , response_type = DnDTimer )
34+ return await self ._send_command (RoborockCommand .GET_DND_TIMER , response_type = DnDTimer )
3535
3636 async def set_dnd_timer (self , dnd_timer : DnDTimer ) -> None :
3737 """Set the Do Not Disturb (DND) timer settings of the device."""
38- await self ._rpc_channel (). send_command (RoborockCommand .SET_DND_TIMER , params = dnd_timer .as_dict ())
38+ await self ._send_command (RoborockCommand .SET_DND_TIMER , params = dnd_timer .as_dict ())
3939
4040 async def clear_dnd_timer (self ) -> None :
4141 """Clear the Do Not Disturb (DND) timer settings of the device."""
42- await self ._rpc_channel (). send_command (RoborockCommand .CLOSE_DND_TIMER )
42+ await self ._send_command (RoborockCommand .CLOSE_DND_TIMER )
Original file line number Diff line number Diff line change @@ -33,12 +33,12 @@ class StatusTrait(Trait):
3333 def __init__ (self , product_info : HomeDataProduct , rpc_channel : Callable [[], V1RpcChannel ]) -> None :
3434 """Initialize the StatusTrait."""
3535 self ._product_info = product_info
36- self ._rpc_channel = rpc_channel
36+ self ._send_command = lambda * args , ** kwargs : rpc_channel (). send_command ( * args , ** kwargs )
3737
3838 async def get_status (self ) -> Status :
3939 """Get the current status of the device.
4040
4141 This is a placeholder command and will likely be changed/moved in the future.
4242 """
4343 status_type : type [Status ] = ModelStatus .get (self ._product_info .model , S7MaxVStatus )
44- return await self ._rpc_channel (). send_command (RoborockCommand .GET_STATUS , response_type = status_type )
44+ return await self ._send_command (RoborockCommand .GET_STATUS , response_type = status_type )
You can’t perform that action at this time.
0 commit comments