Skip to content

Commit

Permalink
fix: update device UUID extraction logic in BaseService
Browse files Browse the repository at this point in the history
Changed the method of extracting the device UUID from the MAC address in the BaseService class. The extraction now uses the last segment of the MAC address instead of the third segment, ensuring correct UUID retrieval for device control and info requests.
  • Loading branch information
SecKatie committed Dec 8, 2024
1 parent 623d6df commit 17db84e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/wyzeapy/services/base_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ async def _lock_control(self, device: Device, action: str) -> None:

url_path = "/openapi/lock/v1/control"

device_uuid = device.mac.split(".")[2]
device_uuid = device.mac.split(".")[-1]

payload = {
"uuid": device_uuid,
Expand All @@ -611,7 +611,7 @@ async def _get_lock_info(self, device: Device) -> Dict[str, Optional[Any]]:

url_path = "/openapi/lock/v1/info"

device_uuid = device.mac.split(".")[2]
device_uuid = device.mac.split(".")[-1]

payload = {
"uuid": device_uuid,
Expand Down

0 comments on commit 17db84e

Please sign in to comment.