Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
flatsiedatsie authored Jan 23, 2024
1 parent 97cff17 commit 413df9d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion js/extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
if(typeof body.debug != 'undefined'){
this.debug = body.debug;
if(this.debug){
console.log("Network presence Init API result: ", body);
console.log("Network presence: debug: init API result: ", body);
if(document.getElementById('extension-network-presence-debug-warning') != null){
document.getElementById('extension-network-presence-debug-warning').style.display = 'block';
}
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
}
},
"short_name": "Network pres",
"version": "2.1.3",
"version": "2.1.4",
"web_accessible_resources": [
"css/*.css",
"images/*.svg",
Expand Down
13 changes: 9 additions & 4 deletions pkg/presence_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ def __init__(self, verbose=False):
#if self.DEBUG:
#print("Persistent data was loaded succesfully") # debug will never be true here unless set in the code above
if 'devices' in self.previous_data:
#pass
self.previously_found = self.previous_data['devices']
else:
#pass
self.previously_found = self.previous_data
else:
print("loaded json was from version 1.0, clearing incompatible persistent data")
Expand Down Expand Up @@ -1418,7 +1420,7 @@ def parse_found_device(self,ip_address,found_device_name="unnamed",mac_address="

new_device = False
possible_name = found_device_name

abort_adding = False

_id = mac_to_id(mac_address) #mac_address.replace(":", "")

Expand All @@ -1440,7 +1442,7 @@ def parse_found_device(self,ip_address,found_device_name="unnamed",mac_address="

if _id not in self.previously_found:
if self.DEBUG:
print("\n\n\n! NEW !\n\nparse_found_device: _id NOT already in previously_found: " + str(_id) + ", ip: " + str(ip_address))
print("\n\n\n!? NEW ?!\n\nparse_found_device: _id NOT already in previously_found: " + str(_id) + ", ip: " + str(ip_address))
print("self.avahi_lookup_table: " + str(self.avahi_lookup_table))
print("self.candle_controllers_ip_list: " + str(self.candle_controllers_ip_list))
print("")
Expand Down Expand Up @@ -1527,7 +1529,9 @@ def parse_found_device(self,ip_address,found_device_name="unnamed",mac_address="
found_device_name = vendor


found_device_name = "Presence - " +str(found_device_name) + ' (' + str(ip_address) + ')'


found_device_name = "Presence - " + str(found_device_name) + ' (' + str(ip_address) + ')'


possible_name = found_device_name
Expand Down Expand Up @@ -1579,6 +1583,7 @@ def parse_found_device(self,ip_address,found_device_name="unnamed",mac_address="
if str(ip_address) == str(self.previously_found[key]['ip']):
if self.DEBUG:
print('\n--> SOMETHING FISHY: same name, same ip address.. just not the same mac?: ' + str(key) + ' =?= ' + str(_id) + '\n')
abort_adding = True
except:
if self.DEBUG:
print("Error, no ip in previously found device data?")
Expand Down Expand Up @@ -1641,7 +1646,7 @@ def parse_found_device(self,ip_address,found_device_name="unnamed",mac_address="
if self.previously_found[_id] != None:
if self.DEBUG:
print("Error, somehow this id was already in the previously_found dict")
else:
elif abort_adding == False:
if self.DEBUG:
print('\nADDING new entry to previously_found')
self.previously_found[_id] = {}
Expand Down

0 comments on commit 413df9d

Please sign in to comment.