mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-29 12:17:01 +00:00
Update docs for Notifications for Android TV / Fire TV
for changes made to service data for icons and images (#31228)
* nfandroidtv - updated docs for my changes and removed a bunch of redundant examples * nfandroidtv - ran a formatter * nfandroidtv - clarified the sections purpose * Apply suggestions from code review --------- Co-authored-by: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com>
This commit is contained in:
parent
5bbb14db3f
commit
da97948088
@ -72,58 +72,43 @@ interrupt: 1
|
||||
|
||||
## Service data for sending images and icons
|
||||
|
||||
The following attributes can be placed inside `data` to send images and icons.
|
||||
|
||||
| Service data attribute | Optional | Description |
|
||||
| ---------------------- | -------- | ----------- |
|
||||
| `image` | yes | Groups the attributes for image upload. If present, either `url` or `path` have to be provided.
|
||||
| `icon` | yes | Groups the attributes for icon upload. If present, either `url` or `path` have to be provided.
|
||||
| `path` | yes | Local path of an image file. Is placed inside `image`, `icon` or both.
|
||||
| `image` | yes | Groups the attributes for image upload. It can take a `url` or `path`. It is optional unless you use authentication options. Then, either `url` or `path` has to be provided. |
|
||||
| `icon` | yes | Groups the attributes for icon upload. It can take a `url` or `path`. It is optional unless you use authentication options. Then, either `url` or `path` has to be provided. |
|
||||
| `path` | yes | Local path of an image file. Is placed inside `image`, `icon`, or both.
|
||||
| `url` | yes | URL of an image file. Is placed inside `image`, `icon` or both.
|
||||
| `username` | yes | Username if the URL requires authentication. Is placed inside `image`, `icon` or both`.
|
||||
| `password` | yes | Password if the URL requires authentication. Is placed inside `image`, `icon` or both.
|
||||
| `auth` | yes | If set to `digest` HTTP-Digest-Authentication is used. If missing, HTTP-BASIC-Authentication is used and is placed inside `image`, `icon` or both.
|
||||
|
||||
Example for posting image from URL:
|
||||
Example Service data for both image and icons:
|
||||
|
||||
```yaml
|
||||
# If your urls do not require extra authentication
|
||||
icon: "http://[url to image file]"
|
||||
image: "http://[url to image file]"
|
||||
|
||||
# Paths in most cases
|
||||
icon: "/you/path/location"
|
||||
image: "/you/path/location"
|
||||
# Or alternatively
|
||||
icon:
|
||||
path: "/you/path/location"
|
||||
image:
|
||||
path: "/you/path/location"
|
||||
|
||||
# If your urls require extra authentication
|
||||
image:
|
||||
url: "http://[url to image file]"
|
||||
username: "optional user, if necessary"
|
||||
password: "optional password, if necessary"
|
||||
auth: "digest"
|
||||
```
|
||||
|
||||
Example for posting image from local path:
|
||||
|
||||
```yaml
|
||||
image:
|
||||
path: "/path/to/file.ext"
|
||||
```
|
||||
|
||||
Example for posting icon from URL:
|
||||
|
||||
```yaml
|
||||
username: "optional user, if necessary" # Optional
|
||||
password: "optional password, if necessary" # Optional
|
||||
auth: "digest" # Optional
|
||||
icon:
|
||||
url: "http://[url to image file]"
|
||||
username: "optional user, if necessary"
|
||||
password: "optional password, if necessary"
|
||||
auth: "digest"
|
||||
```
|
||||
|
||||
Example for posting both image and icon from URL:
|
||||
|
||||
```yaml
|
||||
image:
|
||||
url: "http://[url to image file]"
|
||||
username: "optional user, if necessary"
|
||||
password: "optional password, if necessary"
|
||||
auth: "digest"
|
||||
icon:
|
||||
url: "http://[url to image file]"
|
||||
username: "optional user, if necessary"
|
||||
password: "optional password, if necessary"
|
||||
auth: "digest"
|
||||
username: "optional user, if necessary" # Optional
|
||||
password: "optional password, if necessary" # Optional
|
||||
auth: "digest" # Optional
|
||||
```
|
||||
|
||||
Example of an automation with an service call, full configuration:
|
||||
|
Loading…
x
Reference in New Issue
Block a user