Skip to content

Commit

Permalink
fixed URLs properly (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippMundhenk authored Oct 5, 2023
1 parent 67ae59d commit 8d4c8f3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/uptime_kuma/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ def format_entity_name(string: str) -> str:
def sensor_name_from_url(url: str) -> str:
parsed_url = urlparse(url)
clean_url = parsed_url.netloc.replace(":"+str(parsed_url.port), "")
return clean_url.replace(".", "_")
return re.sub(r"\W+", "_", clean_url)

0 comments on commit 8d4c8f3

Please sign in to comment.