mirror of
https://github.com/home-assistant/developers.home-assistant.git
synced 2025-07-08 18:06:29 +00:00
Add blogpost on new instance url helper (#498)
This commit is contained in:
parent
8c1e567f41
commit
aaa3cb6fa8
32
blog/2020-05-08-instance-url-helper.md
Normal file
32
blog/2020-05-08-instance-url-helper.md
Normal file
@ -0,0 +1,32 @@
|
||||
---
|
||||
author: Franck Nijhof
|
||||
authorURL: https://twitter.com/frenck
|
||||
authorImageURL: /img/profile/frenck.png
|
||||
authorTwitter: frenck
|
||||
title: Instance URL helper
|
||||
---
|
||||
|
||||
If you are an integration developer and came across the problem of getting the
|
||||
URL of the users' Home Assistant instance, you probably know, this wasn't always
|
||||
easy.
|
||||
|
||||
The main problem is that a Home Assistant instance is generally installed, at home.
|
||||
Meaning the internal and external address can be different and even those can
|
||||
have variations (for example, if a user has a Home Assistant Cloud subscription).
|
||||
|
||||
Matters become worse if the integration has specific requirements for the URL;
|
||||
for example, it must be externally available and requires SSL.
|
||||
|
||||
As of Home Assistant Core 0.110, a new instance URL helper is introduced to
|
||||
ease that. We started out with the following flow chart to solve this issue:
|
||||
|
||||
[](/img/en/blog/2020-05-instance-url-helper/flowchart.png)
|
||||
|
||||
As a result of this, the previously available `base_url` is now replaced by two
|
||||
new core configuration settings for the user: the internal and external URL.
|
||||
|
||||
From a development perspective, the use of `hass.config.api.base_url` is now
|
||||
deprecated in favor of the new `get_url` helper method.
|
||||
|
||||
For more information on using and implementing this new URL helper method,
|
||||
consult our documentation [here](/docs/instance_url).
|
BIN
static/img/en/blog/2020-05-instance-url-helper/flowchart.png
Normal file
BIN
static/img/en/blog/2020-05-instance-url-helper/flowchart.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 112 KiB |
Loading…
x
Reference in New Issue
Block a user