Skip to content

Commit

Permalink
Merge pull request #1153 from doronz88/feature/product-type
Browse files Browse the repository at this point in the history
restore: add `Device.product_type`
  • Loading branch information
doronz88 authored Aug 8, 2024
2 parents 8b0ce7c + a00f686 commit 6351c95
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions pymobiledevice3/restore/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ def __init__(self, lockdown: LockdownClient = None, irecv: IRecv = None):

def __repr__(self) -> str:
return (
f'<{self.__class__.__name__} '
f'ecid: {self.ecid} '
f'hardware_model: {self.hardware_model} '
f'image4-support: {self.is_image4_supported}>'
)
f'<{self.__class__.__name__} '
f'ecid: {self.ecid} '
f'hardware_model: {self.hardware_model} '
f'image4-support: {self.is_image4_supported}>'
)

@cached_property
def ecid(self):
Expand Down Expand Up @@ -55,3 +55,9 @@ def preflight_info(self):
with suppress(MissingValueError):
return self.lockdown.preflight_info
return None

@cached_property
def product_type(self) -> str:
if self.lockdown:
return self.lockdown.product_type
return self.irecv.product_type

0 comments on commit 6351c95

Please sign in to comment.