-
Notifications
You must be signed in to change notification settings - Fork 8
Conversation
…rrectly but it is in the PLIST and CLI now)
I think i'm also going to add in a fallback switch/option. The way I see it, if the Apple lookup fails, or the Google lookup fails, you can specify the switch to try and fall back to the other service. If both fails, then report so, otherwise return the proper data. Just an idea.. not too sure how practical this is |
@danner26 Thank you for working on this. I can see people liking the fallback option. I'll review what you have end of day. On first glance everything looks pretty. |
Removed the requests module so it doesnt require any other modules
I changed it around a little so there is logging and it doesn't depend on the requests module (AKA no extra module installs) |
Tested with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@danner26 Overall this is great and works properly. I have a few style nits that I'd like to get cleaned up before merging. Once that is done I'll cut a release with this update.
.gitignore
Outdated
@@ -3,4 +3,7 @@ tmp/ | |||
.pyc |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this was a mistake on my part. Could you please change this line to be *.pyc
and remove lines 7-9 that you added?
val.get('BSSID'), | ||
val.get('SSID_STR'), | ||
val.get('RSSI'))) | ||
request_data['wifiAccessPoints'].append({'macAddress':val.get('BSSID'), 'signalStrength':val.get('RSSI'), 'signalToNoiseRatio':0}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is too long and fails linting. Please change to:
request_data['wifiAccessPoints'].append({
'macAddress': val.get('BSSID'),
'signalStrength': val.get('RSSI'),
'signalToNoiseRatio': 0}
obj = json.loads(data) | ||
dump = json.dumps(request_data).encode("utf8") | ||
try: | ||
request = Request(api_url, dump, {'Content-type': 'application/json'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long and fails linting. Please change to:
request = Request(api_url, dump,
{'Content-type': 'application/json'}
Changes have been implemented. Should be good now. I will create a new pull request once I finish the fallback option. |
Fixed the API for Google and added handling. Also added another CLI switch for manual key input
#27