@@ -11,56 +11,56 @@ def __init__(self, client=None):
1111 super (DeviceActivity , self ).__init__ (client )
1212 self .base_url = URL .V1 + URL .DEVICE_ACTIVITY_URL
1313
14- def _validate_device_mode (self , mode : Optional [str ]) -> Optional [str ]:
14+ def _validate_device_mode (self , device_mode : Optional [str ]) -> Optional [str ]:
1515 """
1616 Validate device communication mode
1717
1818 Args:
19- mode : Device communication mode ("wired" or "wireless")
19+ device_mode : Device communication mode ("wired" or "wireless")
2020
2121 Returns:
22- Validated mode or None if mode is None
22+ Validated device_mode or None if device_mode is None
2323
2424 Raises:
25- BadRequestError: If mode is invalid
25+ BadRequestError: If device_mode is invalid
2626 """
27- if mode is not None :
28- if mode not in (DeviceMode .WIRED , DeviceMode .WIRELESS ):
27+ if device_mode is not None :
28+ if device_mode not in (DeviceMode .WIRED , DeviceMode .WIRELESS ):
2929 raise BadRequestError ("Invalid device mode. Allowed values are 'wired' and 'wireless'." )
30- return mode
30+ return device_mode
3131 return None
3232
33- def create (self , data : Dict [str , Any ], mode : Optional [str ] = None , ** kwargs ) -> Dict [str , Any ]:
33+ def create (self , data : Dict [str , Any ], device_mode : Optional [str ] = None , ** kwargs ) -> Dict [str , Any ]:
3434 """
3535 Create a new device activity for POS gateway
3636
3737 Args:
3838 data: Dictionary containing device activity data in the format expected by rzp-pos-gateway
39- mode : Device communication mode ("wired" or "wireless")
39+ device_mode : Device communication mode ("wired" or "wireless")
4040
4141 Returns:
4242 DeviceActivity object
4343 """
44- device_mode = self ._validate_device_mode (mode )
44+ validated_mode = self ._validate_device_mode (device_mode )
4545
4646 url = self .base_url
47- return self .post_url (url , data , device_mode = device_mode , use_public_auth = True , ** kwargs )
47+ return self .post_url (url , data , device_mode = validated_mode , use_public_auth = True , ** kwargs )
4848
49- def get_status (self , activity_id : str , mode : Optional [str ] = None , ** kwargs ) -> Dict [str , Any ]:
49+ def get_status (self , activity_id : str , device_mode : Optional [str ] = None , ** kwargs ) -> Dict [str , Any ]:
5050 """
5151 Get the status of a device activity
5252
5353 Args:
5454 activity_id: Activity ID to fetch status for
55- mode : Device communication mode ("wired" or "wireless")
55+ device_mode : Device communication mode ("wired" or "wireless")
5656
5757 Returns:
5858 DeviceActivity object with current status
5959 """
6060 if not activity_id :
6161 raise BadRequestError ("Activity ID must be provided" )
6262
63- device_mode = self ._validate_device_mode (mode )
63+ validated_mode = self ._validate_device_mode (device_mode )
6464
6565 url = f"{ self .base_url } /{ activity_id } "
66- return self .get_url (url , {}, device_mode = device_mode , use_public_auth = True , ** kwargs )
66+ return self .get_url (url , {}, device_mode = validated_mode , use_public_auth = True , ** kwargs )
0 commit comments