home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.43k stars 30.67k forks source link

NFAndroidTV: extra keys not allowed (following documentation example) #84645

Closed bcutter closed 1 year ago

bcutter commented 1 year ago

The problem

Using additional config options is not allowed.

Freshly installed integration.

Using this works:

service: notify.fire_tv
data:
  message: "Test-Nachricht"
  title: "Titel"

While this is not:

service: notify.fire_tv
data:
  message: "Test-Nachricht"
  title: "Titel"
  duration: 10
  fontsize: "large"
  position: "top-right"
  color: "grey"
  transparency: "25%"
  timeout: 10
  interrupt: 1

Instead this error is presented:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/connection.py:140
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 20:40:20 (15 occurrences)
Last logged: 21:03:37

[546866068784] Error handling message: extra keys not allowed @ data['duration']. Got None extra keys not allowed @ data['fontsize']. Got None extra keys not allowed @ data['interrupt']. Got None extra keys not allowed @ data['position']. Got None extra keys not allowed @ data['timeout']. Got None extra keys not allowed @ data['transparency']. Got None (invalid_format)

Full message:

Fehler beim Aufrufen des Diensts notify.fire_tv. extra keys not allowed @ data['color']. Got None extra keys not allowed @ data['duration']. Got None extra keys not allowed @ data['fontsize']. Got None extra keys not allowed @ data['interrupt']. Got None extra keys not allowed @ data['position']. Got None extra keys not allowed @ data['timeout']. Got None extra keys not allowed @ data['transparency']. Got None

This is strictly following the configuration options @ https://www.home-assistant.io/integrations/nfandroidtv#configuration-variables

What version of Home Assistant Core has the issue?

core-2022.9.7

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Notifications for Android TV / Fire TV

Link to integration documentation on our website

https://www.home-assistant.io/integrations/nfandroidtv

Diagnostics information

No response

Example YAML snippet

service: notify.fire_tv
data:
  message: "Test-Nachricht"
  title: "Titel"
  duration: 10
  fontsize: "large"
  position: "top-right"
  color: "grey"
  transparency: "25%"
  timeout: 10
  interrupt: 1


### Anything in the logs that might be useful for us?

_No response_

### Additional information

Device used is a Fire TV.

- Syntactical error?
- Bug in integration?
- Bug in documentation?
home-assistant[bot] commented 1 year ago

Hey there @tkdrob, mind taking a look at this issue as it has been labeled with an integration (nfandroidtv) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `nfandroidtv` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign nfandroidtv` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


nfandroidtv documentation nfandroidtv source (message by IssueLinks)

tkdrob commented 1 year ago

The docs show another data: with duration underneath while your yaml example does not. Please add it to fix.

bcutter commented 1 year ago

Update: error found. Syntax error.

Correct one:

service: notify.fire_tv
data:
  message: "Nachricht. Text. Hier."
  title: "Titel HIER"
  data:
    duration: 10
    fontsize: "large"
    position: "top-right"
    color: "grey"
    transparency: "25%"
    timeout: 10
    interrupt: 1

This should be stated clearly in the docs.

tkdrob commented 1 year ago

It actually is in the example:

service: notify.living_room_tv
data:
  title: "Thanks for the water!"
  message: "Nigel is {{ states('sensor.nigel_moisture') }}% moisture"
  data:
    duration: 4
    position: "bottom-left"
    fontsize: "medium"
    transparency: "75%"
    color: "teal"
    interrupt: 0
bcutter commented 1 year ago

OK. It's not right below the configuration section https://www.home-assistant.io/integrations/nfandroidtv#interrupt

grafik

In my opinion the docs should make this more clearly. In detail: provide a full working example instead of the current misleading This is a fully customized YAML you can use inside data to test how the final notification will look like: sentence.

It's solved for me, but I think the docs could do better.

tkdrob commented 1 year ago

That mention of Data is for when people are using UI Mode as we encourage others to do. As this is an open source project, please open a PR in the docs repo with the exact changes you think need to be made so a discussion can be made there.

tkdrob commented 1 year ago

@home-assistant close