You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you send for example:
method: POST_JSON
data_template:
messages:
-source: "home assistant"
to: "+12345678"
body: "test msg"
you will get
{"message": "", "messages": [{"source": "homeassistant", "to": "+12345678", "body": "test msg"}]}
if you add:
message_param_name: ""
you will still get:
{"": "", "messages": [{"source": "homeassistant", "to": "+12345678", "body": "test msg"}]}
suggest adding check for length of message_param_name and if it is empty skip line 152
152: data = {self._message_param_name: message}
something like this maybe:
data = {self._message_param_name: message} if hasattr(message_param_name, 'len') and len(message_param_name) > 0 else {}
or maybe
data = {self._message_param_name: message} if message_param_name != "SUPPRESS_MESSAGE" else {}
probably is better...
What version of Home Assistant Core has the issue?
core
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
REST integration
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered:
The problem
homeassistant/components/rest/notify.py
If you send for example:
method: POST_JSON
data_template:
messages:
-source: "home assistant"
to: "+12345678"
body: "test msg"
you will get
{"message": "", "messages": [{"source": "homeassistant", "to": "+12345678", "body": "test msg"}]}
if you add:
message_param_name: ""
you will still get:
{"": "", "messages": [{"source": "homeassistant", "to": "+12345678", "body": "test msg"}]}
suggest adding check for length of message_param_name and if it is empty skip line 152
152: data = {self._message_param_name: message}
something like this maybe:
data = {self._message_param_name: message} if hasattr(message_param_name, 'len') and len(message_param_name) > 0 else {}
or maybe
data = {self._message_param_name: message} if message_param_name != "SUPPRESS_MESSAGE" else {}
probably is better...
What version of Home Assistant Core has the issue?
core
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
REST integration
Link to integration documentation on our website
No response
Diagnostics information
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
No response
The text was updated successfully, but these errors were encountered: