From 9d76769e31a811cb50526e9ab3a44ced91254994 Mon Sep 17 00:00:00 2001 From: Mryck Date: Wed, 3 Oct 2018 19:43:23 +0200 Subject: [PATCH] Update Xiaomi devices for Configuration variables (#6465) * Configuration Variables Lifx light * Update Xiaomi devices for Configuration variables * :pencil2: Tweaks * :pencil2: Tweaks * :ambulance: Quotes * :ambulance: Quotes * :ambulance: Quotes * :pencil2: Removed extra new line * :ambulance: Fixing build * :ambulance: Fixing build * :ambulance: Fixing Build * :ambulance: Fixing build * :ambulance: Fixing build * :ambulance: Fix build * :rocket: Retrigger build --- source/_components/camera.xiaomi.markdown | 48 ++++++++++++++----- .../device_tracker.xiaomi.markdown | 22 ++++++--- .../media_player.xiaomi_tv.markdown | 15 ++++-- 3 files changed, 62 insertions(+), 23 deletions(-) diff --git a/source/_components/camera.xiaomi.markdown b/source/_components/camera.xiaomi.markdown index d326e7b9c20..14c4f935686 100644 --- a/source/_components/camera.xiaomi.markdown +++ b/source/_components/camera.xiaomi.markdown @@ -13,7 +13,7 @@ ha_release: 0.72 ha_iot_class: "Local Polling" --- -The `Xiaomi` camera platform allows you to utilize Xiaomi Cameras within Home Assistant. +The `Xiaomi` camera platform allows you to utilize Xiaomi Cameras within Home Assistant. To successfully implement this platform, the Home Assistant host should be capable of multiple simultaneous reads. For every concurrent Home Assistant user, a connection will be made to the camera every 10 seconds. This should normally not be a problem. @@ -53,18 +53,42 @@ camera: name: Camera host: '192.168.1.100' model: 'yi' - password: my_password_123 + password: YOUR_PASSWORD ``` -Configuration variables: - -- **name** (*Required*): A human-friendly name for the camera. -- **host** (*Required*): The IP address or hostname of the camera. -- **model** (*Required*): The model of Xiaomi Camera, currently supporting yi and xiaofang. -- **password** (*Required*): The password to the FTP server on the camera (from above), can be any string as the current firmware doesn't allow setting ftp passwords. -- **path** (*Optional*): The path to the raw MP4 files. Defaults to `/media/mmcblk0p1/record`. -- **username** (*Optional*): The user that can access the FTP server. Defaults to `root`. -- **ffmpeg_arguments** (*Optional*): Extra options to pass to `ffmpeg` (e.g., image quality or video filter options). +{% configuration %} +name: + description: A human-friendly name for the camera. + required: true + type: string +host: + description: The IP address or hostname of the camera. + required: true + type: string +model: + description: The model of Xiaomi Camera, currently supporting yi and xiaofang. + required: true + type: string +password: + description: The password to the FTP server on the camera (from above), can be any string as the current firmware doesn't allow setting ftp passwords. + required: true + type: string +path: + description: The path to the raw MP4 files. + required: false + default: /media/mmcblk0p1/record + type: string +username: + description: The user that can access the FTP server. + required: false + default: root + type: string +ffmpeg_arguments: + description: > + Extra options to pass to `ffmpeg` + required: false + type: string +{% endconfiguration %}

The default for `path:` will not work with all cameras. It may be needed that you add that key with the exact path for your device. @@ -82,7 +106,7 @@ camera: name: My Camera host: '192.168.1.100' model: 'xiaofang' - password: my_password_123 + password: YOUR_PASSWORD path: /home/camera/feed ffmpeg_arguments: '-vf scale=800:450' ``` diff --git a/source/_components/device_tracker.xiaomi.markdown b/source/_components/device_tracker.xiaomi.markdown index d38571007cb..640f240efc2 100644 --- a/source/_components/device_tracker.xiaomi.markdown +++ b/source/_components/device_tracker.xiaomi.markdown @@ -12,7 +12,6 @@ ha_category: Presence Detection ha_release: 0.36 --- - The `xiaomi` platform offers presence detection by looking at connected devices to a [Xiaomi](http://miwifi.com) router. To use an Xiaomi router in your installation, add the following to your `configuration.yaml` file: @@ -25,11 +24,20 @@ device_tracker: password: YOUR_ADMIN_PASSWORD ``` -Configuration variables: - -- **host** (*Required*): The IP address of your router, eg. `192.168.0.1`. -- **username** (*Optional*: The admin username. By default `admin`. -- **password** (*Required*): The password for the admin account. +{% configuration %} +host: + description: "The IP address of your router, e.g., `192.168.0.1`." + required: true + type: string +username: + description: The admin username. + required: false + default: admin + type: string +password: + description: The password for the admin account. + required: true + type: string +{% endconfiguration %} See the [device tracker component page](/components/device_tracker/) for instructions how to configure the people to be tracked. - diff --git a/source/_components/media_player.xiaomi_tv.markdown b/source/_components/media_player.xiaomi_tv.markdown index ffc2f1efc7d..e9c3eeb601b 100644 --- a/source/_components/media_player.xiaomi_tv.markdown +++ b/source/_components/media_player.xiaomi_tv.markdown @@ -29,10 +29,17 @@ media_player: When starting or restarting Home Assistant make sure your TV is off. This is a flaw in the TV itself.

-Configuration variables: - -- **host** (*Optional*): The IP of the Xiaomi TV, eg. 192.168.0.10 -- **name** (*Optional*): The name to use on the frontend. Default is 'Xiaomi TV'. +{% configuration %} +host: + description: "The IP of the Xiaomi TV, e.g., `192.168.0.10`." + required: false + type: string +name: + description: The name to use on the frontend. + required: false + default: Xiaomi TV + type: string +{% endconfiguration %} If you do not set a host in the configuration file, local TVs will automatically be discovered.