mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Allow a protocol in the http.base_url parameter (#5557)
This commit is contained in:
parent
3f2fdb97a0
commit
295a232374
@ -61,7 +61,9 @@ class API(object):
|
|||||||
self.port = port
|
self.port = port
|
||||||
self.api_password = api_password
|
self.api_password = api_password
|
||||||
|
|
||||||
if use_ssl:
|
if host.startswith(("http://", "https://")):
|
||||||
|
self.base_url = host
|
||||||
|
elif use_ssl:
|
||||||
self.base_url = "https://{}".format(host)
|
self.base_url = "https://{}".format(host)
|
||||||
else:
|
else:
|
||||||
self.base_url = "http://{}".format(host)
|
self.base_url = "http://{}".format(host)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user