From 295a23237465d378a96dccb7c88839ab87eedca5 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Thu, 26 Jan 2017 21:43:45 -0800 Subject: [PATCH] Allow a protocol in the http.base_url parameter (#5557) --- homeassistant/remote.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/remote.py b/homeassistant/remote.py index 69e8b88305f..c124d509f9c 100644 --- a/homeassistant/remote.py +++ b/homeassistant/remote.py @@ -61,7 +61,9 @@ class API(object): self.port = port 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) else: self.base_url = "http://{}".format(host)