dummylabs / thewatchman

Home Assistant custom integration to keep track of missing entities and actions in your config files
MIT License
481 stars 20 forks source link

Extend service settings with GUI options in HA #18

Closed nagyrobi closed 2 years ago

nagyrobi commented 2 years ago

...and add chunk_size option too

dummylabs commented 2 years ago

@nagyrobi Thanks, this should be handy. Is there a way to edit "Notification service data" parameter so that it's sent to the service as yaml dictionary? If this is not possible via UI, this option should be hidden in my opinion. So far this field holds [object Object] which is not editable.

nagyrobi commented 2 years ago

Added multiline support for that text field so you can enter the parameters on new lines, like a dictionary looks like. Needs testing which I can't do because I don't use any external notification services.

dummylabs commented 2 years ago

Can I ask you to test it with persistent_notification.create which is a part of Home Assistant and requires zero configuration? It has a parameter named title which can be used for testing. The working yaml example:

service: watchman.report
data:
  send_notification: true
  service: persistent_notification.create
  data:
    title: my title
dummylabs commented 2 years ago

so you can enter the parameters on new lines, like a dictionary looks like

As far as I see, Home Assistant transforms user input into a string, not a dictionary when you switch from UI to yaml mode. JSON mode would help here, but I don't know if it can be set for a UI field.

nagyrobi commented 2 years ago

Yes it can only be a string, you'll have to accomodate with that. Other way is if you have a known list of possible options, those could be listed in a dropdown box and the user would select the appropriate one.

nagyrobi commented 2 years ago

If this is not possible via UI, this option should be hidden in my opinion

This option is hidden from GUI, remains as a yaml-option.