diff --git a/custom_components/greenapi/manifest.json b/custom_components/greenapi/manifest.json index 2c405db..afd46e2 100644 --- a/custom_components/greenapi/manifest.json +++ b/custom_components/greenapi/manifest.json @@ -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.3.0" + "version": "0.4.0" } diff --git a/custom_components/greenapi/notify.py b/custom_components/greenapi/notify.py index f775608..c03ccb7 100644 --- a/custom_components/greenapi/notify.py +++ b/custom_components/greenapi/notify.py @@ -48,7 +48,7 @@ def send_message(self, message="", **kwargs): title = kwargs.get(ATTR_TITLE) if title is not None: title = f"*{title}*" - message = f"{title} \n {message}" + message = f"{title}\n{message}" data = kwargs.get(ATTR_DATA) target = kwargs.get(ATTR_TARGET)[0] if kwargs.get(ATTR_TARGET) is not None else self._target #Allow setting the target from either the service-call or the service config. Service call target can override the default config. _LOGGER.info(f"Sending message to {target}") @@ -66,6 +66,7 @@ def send_message(self, message="", **kwargs): return else: _LOGGER.warn("Sending message to %s: excluding the file '%s' that was not found", kwargs.get(ATTR_TARGET)[0], file_path) - self._greenAPI.sending.sendMessage(target, message) + self._greenAPI.sending.sendMessage(target, message, linkPreview=False) except Exception as e: - _LOGGER.error("Sending message to %s: has failed with the following error %s", kwargs.get(ATTR_TARGET)[0], str(e)) \ No newline at end of file + _LOGGER.error("Sending message to %s: has failed with the following error %s", kwargs.get(ATTR_TARGET)[0], str(e)) +