Skip to content

Commit

Permalink
Adding support for title
Browse files Browse the repository at this point in the history
  • Loading branch information
t0mer committed Apr 5, 2024
1 parent 131d470 commit d129a00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/greenapi/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
"iot_class": "local_polling",
"issue_tracker": "https://github.com/t0mer/green-api-custom-notifier",
"requirements": ["whatsapp-api-client-python"],
"version": "0.2.0"
"version": "0.3.0"
}
4 changes: 4 additions & 0 deletions custom_components/greenapi/notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ def send_message(self, message="", **kwargs):
"""Send a message to the target."""

try:
title = kwargs.get(ATTR_TITLE)
if title is not None:
title = f"*{title}*"
message = f"{title} \n {message}"
data = kwargs.get(ATTR_DATA)
target = kwargs.get(ATTR_TARGET)[0]
_LOGGER.info(f"Sending message to {target}")
Expand Down

0 comments on commit d129a00

Please sign in to comment.