Skip to content

Commit

Permalink
🔌 Omada work #708
Browse files Browse the repository at this point in the history
  • Loading branch information
jokob-sk committed Jul 6, 2024
1 parent 75bcf42 commit 5544009
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion server/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ def update_devices_names (db):
# Check if the variable contains a valid MAC address or "Internet"
def check_mac_or_internet(input_str):
# Regular expression pattern for matching a MAC address
mac_pattern = r'^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$'
mac_pattern = r'([0-9A-Fa-f]{2}[:-][0-9A-Fa-f]{2}[:-][0-9A-Fa-f]{2}[:-][0-9A-Fa-f]{2}[:-][0-9A-Fa-f]{2}[:-][0-9A-Fa-f]{2})'

if input_str.lower() == 'internet':
return True
Expand Down
2 changes: 1 addition & 1 deletion server/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ def extract_between_strings(text, start, end):

#-------------------------------------------------------------------------------
def extract_mac_addresses(text):
mac_pattern = r"([0-9A-Fa-f]{2}(?:[:-][0-9A-Fa-f]{2}){5})"
mac_pattern = r"([0-9A-Fa-f]{2}[:-][0-9A-Fa-f]{2}[:-][0-9A-Fa-f]{2}[:-][0-9A-Fa-f]{2}[:-][0-9A-Fa-f]{2}[:-][0-9A-Fa-f]{2})"
mac_addresses = re.findall(mac_pattern, text)
return mac_addresses

Expand Down

0 comments on commit 5544009

Please sign in to comment.