Skip to content

Commit

Permalink
restore: add Device.product_type
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Aug 8, 2024
1 parent 8b0ce7c commit a00f686
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 a00f686

Please sign in to comment.