Skip to content

Commit

Permalink
1.5.8
Browse files Browse the repository at this point in the history
Check for empty data before using

1.5.6
Argh - more deletion of endpoints from apple
This is a quick 'monkey-fix' to get up and going after Apple deletes all the Friends endpoints.
Working in my brief testing - will check more when able/time.
Essentially this removes support for friend devices as end point is gone.
(as before big fix change devices to Family sharing type)

1.5.5
Add address city, suburb, country, house number, road - state to Family devices to construct own address string.
address = summary string, which is quite long

1.5.3
Use OSM to generate address data from lat/Long as no longer supplied by apple device
Update WazeRouteCaculator

1.5.2
Update Waze Router Calculator
Add labels to family devices

1.5.1

Apple has big server changes which this is a response to.

Remove support for 'Friends'.  Bugger.

What does this mean?
It means we can no longer access Friend data in any fashion.
We can access Family and Own Device data (every family device, and every personal device)

What does this mean?
Well I suspect most usage is within Families, so I would go into current iFriendDevice and edit it to iFriend Family device.
Save and restart Plugin - hopefully everything now continues

non-2FA accounts have largely been depreciated given back end issues.
  • Loading branch information
Ghawken committed May 20, 2023
1 parent 45c29ba commit e9695de
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 25 deletions.
2 changes: 1 addition & 1 deletion iFindFriendsMini.indigoPlugin/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>PluginVersion</key>
<string>1.5.6</string>
<string>1.5.8</string>
<key>ServerApiVersion</key>
<string>3.0</string>
<key>CFBundleDisplayName</key>
Expand Down
52 changes: 28 additions & 24 deletions iFindFriendsMini.indigoPlugin/Contents/Server Plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,7 @@ def refreshData(self):
for dev in indigo.devices.iter("self.FindFriendsFriend"):
# Check AppleID of Device
if dev.enabled:
self.logger.info(f"{dev.name} : These devices are depreciated by apple, please convert a Family Device or Delete")
targetFriend = dev.pluginProps['targetFriend']
if self.debugicloud:
self.logger.debug(u'targetFriend of Device equals:' + str(targetFriend))
Expand Down Expand Up @@ -1268,10 +1269,6 @@ def refreshDataforMyDevice(self,dev, appleDevice):
# self.logger.error(devices.status())
# self.logger.error(devices.location())

locationdata = appleDevice.location()
devicestatus = appleDevice.status(additional=["deviceModel","batteryStatus"])
deviceid = appleDevice['id']

if appleDevice is None:
self.logger.debug(u'No data received for device:' + str(
dev.name) + ' . Most likely device is offline/airplane mode or has disabled sharing location')
Expand All @@ -1282,6 +1279,10 @@ def refreshDataforMyDevice(self,dev, appleDevice):
dev.updateStateImageOnServer(indigo.kStateImageSel.SensorOff)
return

locationdata = appleDevice.location()
devicestatus = appleDevice.status(additional=["deviceModel","batteryStatus"])
deviceid = appleDevice['id']

if locationdata is None:
self.logger.debug(u'No data received for device:' + str(
dev.name) + ' . Most likely device is offline/airplane mode or has disabled sharing location')
Expand Down Expand Up @@ -1840,28 +1841,28 @@ def iAuthorise(self, iUsername, iPassword):

#self.logger.debug(u'self.appleAPI.devices equals:')
#self.logger.debug(str(self.appleAPI.devices))
self.logger.debug(u"{0:=^130}".format(""))
self.logger.debug(u"{0:=^130}".format(""))
self.logger.debug(u'self.appleAPI.friends.details equals:')
#self.logger.debug(u"{0:=^130}".format(""))
#self.logger.debug(u"{0:=^130}".format(""))
#self.logger.debug(u'self.appleAPI.friends.details equals:')
# self.logger.erlogger.errorror(f"{self.appleAPI.friends.data}")
self.logger.debug(u"{0:=^130}".format(""))
self.logger.debug(u"{0:=^130}".format(""))
# self.logger.debug(u"{0:=^130}".format(""))
#self.logger.debug(u"{0:=^130}".format(""))
#self.logger.debug(u'self.appleAPI.friends.locations equals:')
#self.logger.debug(str(self.appleAPI.friends.locations))
self.logger.debug(u"{0:=^130}".format(""))
self.logger.debug(u"{0:=^130}".format(""))
self.logger.debug(u'Type of self.appleAPI.friends.locations equals:')
#self.logger.debug(u"{0:=^130}".format(""))
# self.logger.debug(u"{0:=^130}".format(""))
# self.logger.debug(u'Type of self.appleAPI.friends.locations equals:')
#self.logger.debug(str(type(self.appleAPI.friends.locations)))
self.logger.debug(u"{0:=^130}".format(""))
#self.logger.debug(u"{0:=^130}".format(""))
self.logger.debug(u'Type of self.appleAPI.friends.data')
#self.logger.debug(u"{0:=^130}".format(""))
#self.logger.debug(u'Type of self.appleAPI.friends.data')
#self.logger.debug(str(type(self.appleAPI.friends.data)))
self.logger.debug(u"{0:=^130}".format(""))
self.logger.debug(u"{0:=^130}".format(""))
self.logger.debug(u'self.appleAPI.friends.data equals')
#self.logger.debug(u"{0:=^130}".format(""))
#self.logger.debug(u"{0:=^130}".format(""))
#self.logger.debug(u'self.appleAPI.friends.data equals')
#self.logger.debug(str(self.appleAPI.friends.data))
self.logger.debug(u"{0:=^130}".format(""))
self.logger.debug(u"{0:=^130}".format(""))
#self.logger.debug(u"{0:=^130}".format(""))
# self.logger.debug(u"{0:=^130}".format(""))
# self.logger.debug(u'self.appleAPI.friends.data[followers] equals:')
#self.logger.debug(str(self.appleAPI.friends.data['followers']))
self.logger.debug(u"{0:=^130}".format(""))
Expand All @@ -1870,9 +1871,9 @@ def iAuthorise(self, iUsername, iPassword):
#follower = self.appleAPI.friends.data['followers']
#self.logger.debug(u'follower or self.appleAPI.friends.data[followers] equals:')

self.logger.debug(u"{0:=^130}".format(""))
self.logger.debug(u"{0:=^130}".format(""))
self.logger.debug(u'self.appleAPI.friends.details equals:')
#self.logger.debug(u"{0:=^130}".format(""))
#self.logger.debug(u"{0:=^130}".format(""))
# self.logger.debug(u'self.appleAPI.friends.details equals:')
#self.logger.debug(str(self.appleAPI.friends.details))
self.logger.debug(u"{0:=^130}".format(""))
self.logger.debug(u"{0:=^130}".format(""))
Expand Down Expand Up @@ -2071,7 +2072,7 @@ def urlGenerate(self, latitude, longitude, mapAPIKey, iHorizontal, iVertical, iZ

mapOSM = 'http://staticmap.openstreetmap.de/staticmap.php?center='+str(latitude)+','+str(longitude)+'&'+str(mapZoom)+'&' + mapSize + '&markers='+str(latitude)+','+str(longitude)+','+str(mapLabel)

if self.mapType =='arcgisWorld2d' or 'Bing' in self.mapType or self.mapType=='arcgisWorldImagery' or self.mapType=='arcgisWorldStreetMap' or self.mapType=='arcgisWorldImageryHybrid' or self.mapType=='maps.six':
if self.mapType=="satellitespro" or self.mapType =='arcgisWorld2d' or 'Bing' in self.mapType or self.mapType=='arcgisWorldImagery' or self.mapType=='arcgisWorldStreetMap' or self.mapType=='arcgisWorldImageryHybrid' or self.mapType=='maps.six':
latitude = float(latitude)
longitude = float(longitude)
# Fudge a similar zoom
Expand All @@ -2092,6 +2093,9 @@ def urlGenerate(self, latitude, longitude, mapAPIKey, iHorizontal, iVertical, iZ
mapWorld2d = 'http://maps.six.nsw.gov.au/arcgis/rest/services/public/NSW_Imagery/MapServer/export?bbox=' + str(
toplongitude) + ',' + str(toplatitude) + ',' + str(bottomlongitude) + ',' + str(
bottomlatitude) + '&bboxSR=4326' + '&size=' + str(iHorizontal) + ',' + str(iVertical) + '&f=image'
if self.mapType == "satellitespro":
mapWorld2d = f"https://satellites.pro/#{latitude},{longitude},{zoomFactor}"

if 'Bing' in self.mapType:
mapWorld2d = 'http://bing.com/maps/embed?cp=' + str(latitude) + '~' + str(longitude) + "&h="+str(iVertical)+ "&w="+str(iHorizontal)
BingStatic = 'http://dev.virtualearth.net/REST/v1/Imagery/Map'
Expand Down Expand Up @@ -2127,7 +2131,7 @@ def urlGenerate(self, latitude, longitude, mapAPIKey, iHorizontal, iVertical, iZ
return customURL, urlmapGoogle
elif self.mapType=='openstreetmap':
return mapOSM, urlmapGoogle
elif self.mapType =='arcgisWorld2d' or self.mapType=='arcgisWorldImagery' or self.mapType=='arcgisWorldStreetMap' or self.mapType=='maps.six':
elif self.mapType=="satellitespro" or self.mapType =='arcgisWorld2d' or self.mapType=='arcgisWorldImagery' or self.mapType=='arcgisWorldStreetMap' or self.mapType=='maps.six':
return mapWorld2d, urlmapGoogle
elif 'Bing' in self.mapType:
return BingStatic, mapWorld2d
Expand Down
Empty file.

0 comments on commit e9695de

Please sign in to comment.