This commit is contained in:
SpudGunMan
2024-08-09 23:19:30 -07:00
parent 35df43b727
commit f73cd5ec31
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -151,15 +151,15 @@ def get_name_from_number(number, type='long', nodeInt=1):
return number
def get_num_from_short_name(short_name, nodeInt=1):
# Get the node number from the short name
# Get the node number from the short name, converting all to lowercase for comparison (good practice?)
logger.debug(f"System: Getting Node Number from Short Name: {short_name} on Device: {nodeInt}")
if nodeInt == 1:
for node in interface1.nodes.values():
if str(short_name) == node['user']['shortName']:
if str(short_name.lower()) == node['user']['shortName'].lower():
return node['num']
if nodeInt == 2:
for node in interface2.nodes.values():
if str(short_name) == node['user']['shortName']:
if str(short_name.lower()) == node['user']['shortName'].lower():
return node['num']
return 0