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:
nyangogo 2024-05-22 14:35:35 +01:00 committed by GitHub
parent 5bbb14db3f
commit da97948088
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -72,58 +72,43 @@ interrupt: 1
## Service data for sending images and icons ## 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 | | Service data attribute | Optional | Description |
| ---------------------- | -------- | ----------- | | ---------------------- | -------- | ----------- |
| `image` | yes | Groups the attributes for image upload. If present, either `url` or `path` have to be provided. | `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. If present, either `url` or `path` have 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. | `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. | `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`. | `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. | `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. | `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 ```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: image:
url: "http://[url to image file]" url: "http://[url to image file]"
username: "optional user, if necessary" username: "optional user, if necessary" # Optional
password: "optional password, if necessary" password: "optional password, if necessary" # Optional
auth: "digest" auth: "digest" # Optional
```
Example for posting image from local path:
```yaml
image:
path: "/path/to/file.ext"
```
Example for posting icon from URL:
```yaml
icon: icon:
url: "http://[url to image file]" url: "http://[url to image file]"
username: "optional user, if necessary" username: "optional user, if necessary" # Optional
password: "optional password, if necessary" password: "optional password, if necessary" # Optional
auth: "digest" auth: "digest" # Optional
```
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"
``` ```
Example of an automation with an service call, full configuration: Example of an automation with an service call, full configuration: