-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dasher body value automatically converted to string from dictionary #3
Comments
I think you're correct about the schema. The docs state the following...
|
As a simple workaround for the time being, I had to fork the dasher project and change the line 64 in the lib/dasher.js (https://github.com/achelius/dasher/blob/master/lib/dasher.js) from: to make sure that the value is correctly interpreted as json dictionary if it's a string and json option is true I don't know how to fix the problem by only changing the config.json of the homeassistant addon but this is how I fixed it for now and it works for my use case |
Hi guys. thanks for the testing, and apologies for the delay in response - I was away "off the net" for a few days (it was nice !). I'd prefer an approach to resolve this issue via change in hass.io config rather than in the dasher code. IMO its nicer to keep the dasher code 1:1 with the master so any changes can be merged easily. |
I tried that workaround mainly because I wasn't an expert on home assistant and simply forgot the fact that I could have used events instead, those are the best solution for my usecase |
Right now the only way we can use hass.io add-on options is to change dasher code to use an alternative JSON structure. This is not a change I'm willing to do as I want to keep the dasher code per the master. |
even with base configuration, after a restart of the addon, the body entry of every button is changed from dictionary to str
with this url:
"url": "https://domain:8123/api/services/input_boolean/toggle",
from
"body": {"entity_id": "input_boolean.dash"}
to
"body": "{'entity_id': 'input_boolean.dash'}"
causing the error:
Invalid service data for input_boolean.toggle: expected a dictionary. Got "{'entity_id': 'input_boolean.dash'}"
the schema for body has body considered as str and this I think causes the error
I tried to search for a solution from the manual but i couldn't find one right away
The text was updated successfully, but these errors were encountered: