Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify hostname for discovery #474

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pawlizio
Copy link
Collaborator

@pawlizio pawlizio commented Jan 7, 2025

No description provided.

@@ -41,7 +41,7 @@ def add_info_and_host(fut: Future) -> None:
info: AsyncServiceInfo = fut.result()
self.infos.append(info)
host = VeluxHost(
hostname=info.name.replace("._http._tcp.local.", ""),
hostname=info.name.replace("._http._tcp.local.", "").upper().replace("LAN_", ""), # KLF report it's hostname within DHCP requests without the "LAN_" prefix
Copy link
Owner

@Julius2342 Julius2342 Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im fine with this hack - May i ask you to do this in in a separate function:

def sanitize_hostname(hostname):
    hostname=hostname.upper()
    hostname=hostname.replace("._HTTP._TCP.LOCAL.", "")
    # KLF report it's hostname within DHCP requests with the "LAN_" prefix
    hostname=hostname.replace("LAN_", "")
    return hostname

and hostname=sanitize_hostname(info.name)

and then hostname=hostname within the parameter...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants