pyicloud icon indicating copy to clipboard operation
pyicloud copied to clipboard

FindMyiPhone : reduce battery usage

Open Quentame opened this issue 5 years ago • 1 comments
trafficstars

Breaking changes

  • FindMyiPhoneServiceManager --> FindMyiPhoneService
  • find my iPhone devices fetch is now manual --> you have to call FindMyiPhoneService.refresh_client() to update devices
  • find my iPhone devices does not include family devices by default, you have to with_family=False at your PyiCloudService init.
  • FindMyiPhoneService will return the service, not devices
  • AppleDevice.status function is renamed by attrs

Changes

  • we do not fetch every time we get a device status or location

Not changes

  • PyiCloudService.devices will keep to same behavior ⚠️ WILL DO I/O and request all your devices
  • PyiCloudService.iphone will keep to same behavior ⚠️ WILL DO I/O and request all your devices

Additions

  • get the Find my iPhone service with PyiCloudService.find_my_iphone, no devices will be fetched
  • you can set the with_family boolean param to True to the PyiCloudService to get your family devices fetches.
  • do find_my_iphone_service.refresh_client() to fetch and update devices
  • Apple device attrs are available as properties

Quentame avatar Feb 08 '20 12:02 Quentame

Also update read_me

Quentame avatar Feb 09 '20 12:02 Quentame