Skip to content

Conversation

@mib1185
Copy link
Collaborator

@mib1185 mib1185 commented Jan 17, 2026

This replaces the method get_prefixed_host() by base_url property to allow user defined port

@coveralls
Copy link

Coverage Status

coverage: 96.906% (+0.09%) from 96.816%
when pulling 20bd8ce on mib1185:replace-get_prefixed_host-method-by-base_url-property-to-allow-user-defined-port
into c5b2f82 on hthiery:master.

@flabbamann
Copy link
Contributor

What's the use case? Can you change the port the fritzbox is using? 🤔

@mib1185
Copy link
Collaborator Author

mib1185 commented Jan 17, 2026

You can change the port when using the remote acces via myfritz (see this feature request)

if host.startswith("https://") or host.startswith("http://"):
self.base_url = f"{host}:{port}" if port else host
else:
self.base_url = f"http://{host}:{port}" if port else f"http://{host}"
Copy link
Contributor

@flabbamann flabbamann Jan 18, 2026

Choose a reason for hiding this comment

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

Maybe we should not assume http but https if the port ist 443 here, so we don't get errors if someone enters the port but not the url scheme. I'm unsure how realistic this is 😉.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah, this logic is just adopted from the get_prefixed_host(), so I didn't want to change the behaviour of the host field now 😬

@flabbamann
Copy link
Contributor

You can change the port when using the remote acces via myfritz (see this feature request)

Interesting. I don't use myfritz, so I didn't know that. Just a small note. Code looks good apart from that. Thank you 👍 .

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.

3 participants