pull/35314/head
Trey Moen 1 week ago
parent cd19320034
commit 97a419cd2a
  1. 12
      system/hardware/tici/esim.py

@ -42,12 +42,6 @@ class LPA2:
def get_active_profile(self) -> dict[str, str] | None: def get_active_profile(self) -> dict[str, str] | None:
return next((p for p in self.list_profiles() if p['enabled']), None) return next((p for p in self.list_profiles() if p['enabled']), None)
def process_notifications(self) -> None:
"""
Process notifications from the LPA, typically to activate/deactivate the profile with the carrier.
"""
self.validate_successful(self._invoke('notification', 'process', '-a', '-r'))
def enable_profile(self, iccid: str) -> None: def enable_profile(self, iccid: str) -> None:
self.validate_profile_exists(iccid) self.validate_profile_exists(iccid)
latest = self.get_active_profile() latest = self.get_active_profile()
@ -94,6 +88,12 @@ class LPA2:
self.validate_profile_exists(iccid) self.validate_profile_exists(iccid)
self.validate_successful(self._invoke('profile', 'nickname', iccid, nickname)) self.validate_successful(self._invoke('profile', 'nickname', iccid, nickname))
def process_notifications(self) -> None:
"""
Process notifications stored on the eUICC, typically to activate/deactivate the profile with the carrier.
"""
self.validate_successful(self._invoke('notification', 'process', '-a', '-r'))
def validate_profile_exists(self, iccid: str) -> None: def validate_profile_exists(self, iccid: str) -> None:
if not any(p['iccid'] == iccid for p in self.list_profiles()): if not any(p['iccid'] == iccid for p in self.list_profiles()):
raise LPAProfileNotFoundError(f'profile {iccid} does not exist') raise LPAProfileNotFoundError(f'profile {iccid} does not exist')

Loading…
Cancel
Save