Refactor Freebox : add config flow + temperature sensor + sign… (#11712)

* Add config flow to Freebox

* ✏️ Tweak

* Review from frenck

Co-authored-by: Klaas Schoute <klaas_schoute@hotmail.com>
This commit is contained in:
Quentame 2020-03-12 11:23:54 +01:00 committed by GitHub
parent ec6fe7b8b9
commit 10e724f16c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,6 +10,8 @@ ha_release: 0.85
ha_iot_class: Local Polling ha_iot_class: Local Polling
ha_codeowners: ha_codeowners:
- '@snoof85' - '@snoof85'
- '@Quentame'
ha_config_flow: true
ha_domain: freebox ha_domain: freebox
--- ---
@ -17,15 +19,26 @@ The `freebox` integration allows you to observe and control [Freebox router](htt
There is currently support for the following device types within Home Assistant: There is currently support for the following device types within Home Assistant:
* [Sensor](#sensor) with traffic metrics * [Sensor](#sensor) with traffic and temperature metrics
* [Device tracker](#presence-detection) for connected devices * [Device tracker](#presence-detection) for connected devices
* [Switch](#switch) to control Wi-Fi * [Switch](#switch) to control Wi-Fi
## Configuration ## Configuration
If you have enabled the [discovery component](/integrations/discovery/), If you have enabled the [discovery integration](/integrations/discovery/), your Freebox should be detected automatically.
your Freebox should be detected automatically. Otherwise, you can set it Otherwise, you can set it up manually via the frontend or via your `configuration.yaml` file.
up manually in your `configuration.yaml` file:
You can find out your Freebox host and port by opening this address <http://mafreebox.freebox.fr/api_version> in your browser.
The returned JSON should contain an `api_domain` (`host`) and a `https_port` (`port`).
Please consult the [API documentation](https://dev.freebox.fr/sdk/os/) for more information.
### Via the frontend
Menu: **Configuration** -> **Integrations**. Search for "Freebox", add your host and port, click submit.
If you add the integration for the first time, follow the instructions in the [Initial setup](#initial-setup) section.
### Via the configuration file
```yaml ```yaml
freebox: freebox:
@ -44,28 +57,23 @@ port:
type: string type: string
{% endconfiguration %} {% endconfiguration %}
You can find out your Freebox host and port by opening the address <http://mafreebox.freebox.fr/api_version> in your browser. The
returned JSON should contain an `api_domain` (`host`) and a `https_port` (`port`).
Please consult the [API documentation](https://dev.freebox.fr/sdk/os/) for more information.
<div class='note warning'> <div class='note warning'>
If you change your Freebox router for a new one, you need to delete the `freebox.conf` file located in your Home Assistant configuration directory to make the association again. If you change your Freebox router for a new one, go into your Home Assistant configuration `.storage` folder and delete the "freebox" folder, then add the integration again.
</div> </div>
### Initial setup ### Initial setup
<div class='note warning'> <div class='note warning'>
You must have set a password for your Freebox router web administration page. Enable the option "Permettre les nouvelles demandes d'associations" and check that the option "Accès à distance sécurisé à Freebox OS" is active in "Gestion des ports" > "Connexions entrantes".
You must have set a password for your Freebox router web administration page. Enable the option "Permettre les nouvelles demandes d'associations" and check that the option "Accès à distance sécurisé à Freebox OS" is active in "Gestion des ports" > "Connexions entrantes".
</div> </div>
The first time Home Assistant will connect to your Freebox, you will need to The first time Home Assistant will connect to your Freebox, you will need to authorize it by pressing the right arrow on the facade of the Freebox when prompted to do so.
authorize it by pressing the right arrow on the facade of the Freebox when
prompted to do so.
To make the Wi-Fi switch and the reboot service working you will have to add "Modification des réglages de la Freebox To make the Wi-Fi switch and the reboot service working you will have to add "Modification des réglages de la Freebox" permission to Home Assistant application in "Paramètres de la Freebox" > "Gestion des accès" > "Applications".
" permission to Home Assistant application in "Paramètres de la Freebox" > "Gestion des accès" > "Applications".
### Supported routers ### Supported routers
@ -77,8 +85,7 @@ Only the routers with Freebox OS are supported:
## Presence Detection ## Presence Detection
This platform offers presence detection by keeping track of the This platform offers presence detection by keeping track of the devices connected to a [Freebox](https://www.free.fr/) router.
devices connected to a [Freebox](https://www.free.fr/) router.
### Notes ### Notes
@ -93,8 +100,8 @@ refreshes the devices states.
## Sensor ## Sensor
This platform offers you sensors to monitor a Freebox router. The monitored conditions are This platform offers you sensors to monitor a Freebox router.
instant upload and download rates in KB/s. The monitored conditions are internal temperature and upload and download rates in KB/s.
## Service ## Service