From c3b98043f75edf944ec05d92e08a8a6a840094f8 Mon Sep 17 00:00:00 2001 From: claude Date: Wed, 22 Jul 2026 19:43:36 +0300 Subject: [PATCH] Reinstate greeting as an auto-reply used only when Assist is off The greeting option returns, but it is now sent as an automatic reply to incoming messages only when "Route incoming messages to Assist" is disabled, so senders get an acknowledgement instead of silence. When Assist handles messages the greeting is not used. Blank disables it. Co-Authored-By: Claude Opus 4.8 --- README.md | 3 +++ custom_components/reticulum/__init__.py | 6 ++++++ custom_components/reticulum/config_flow.py | 5 +++++ custom_components/reticulum/const.py | 1 + custom_components/reticulum/manifest.json | 2 +- custom_components/reticulum/strings.json | 2 ++ custom_components/reticulum/translations/en.json | 2 ++ custom_components/reticulum/translations/ru.json | 2 ++ 8 files changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f366b9e..a79f358 100644 --- a/README.md +++ b/README.md @@ -105,6 +105,9 @@ will answer. will answer. - **Default recipient** – address the `notify.reticulum_send_message` entity sends to (see Entities below). +- **Greeting / auto-reply** – message sent automatically in reply to incoming + messages **only when "Route incoming messages to Assist" is off** (so senders + get an acknowledgement instead of silence). Blank = disabled. - **Default delivery method** – `direct`, `opportunistic`, or `propagated`. - **Announce interval** – periodic re-announce (seconds; `0` disables). - **Propagation node** + **sync interval** – optional store-and-forward node so diff --git a/custom_components/reticulum/__init__.py b/custom_components/reticulum/__init__.py index 4c7a331..bf6219a 100644 --- a/custom_components/reticulum/__init__.py +++ b/custom_components/reticulum/__init__.py @@ -34,6 +34,7 @@ from .const import ( CONF_ASSIST_LANGUAGE, CONF_DISPLAY_NAME, CONF_ENABLE_ASSIST, + CONF_GREETING, CONF_INTERFACE_NAME, CONF_LOGLEVEL, CONF_PROPAGATION_NODE, @@ -235,7 +236,12 @@ def _make_incoming_handler( _LOGGER.debug("Ignoring message from non-allowed sender %s", source) return + # When messages are NOT routed to Assist, optionally auto-reply with the + # greeting so senders get an acknowledgement instead of silence. if not options.get(CONF_ENABLE_ASSIST, True): + greeting = (options.get(CONF_GREETING) or "").strip() + if greeting: + await _reply(runtime.manager, source, greeting, "Home Assistant") return text = (payload.get("content") or "").strip() diff --git a/custom_components/reticulum/config_flow.py b/custom_components/reticulum/config_flow.py index c42b217..275a036 100644 --- a/custom_components/reticulum/config_flow.py +++ b/custom_components/reticulum/config_flow.py @@ -41,6 +41,7 @@ from .const import ( CONF_DELIVERY_METHOD, CONF_DISPLAY_NAME, CONF_ENABLE_ASSIST, + CONF_GREETING, CONF_INTERFACE_NAME, CONF_LOGLEVEL, CONF_PROPAGATION_NODE, @@ -194,6 +195,10 @@ class ReticulumOptionsFlow(OptionsFlow): "suggested_value": opts.get(CONF_DEFAULT_RECIPIENT, "") }, ): TextSelector(), + vol.Optional( + CONF_GREETING, + description={"suggested_value": opts.get(CONF_GREETING, "")}, + ): TextSelector(TextSelectorConfig(multiline=True)), vol.Required( CONF_DELIVERY_METHOD, default=opts.get(CONF_DELIVERY_METHOD, DEFAULT_DELIVERY_METHOD), diff --git a/custom_components/reticulum/const.py b/custom_components/reticulum/const.py index d907f31..a52dcc3 100644 --- a/custom_components/reticulum/const.py +++ b/custom_components/reticulum/const.py @@ -27,6 +27,7 @@ CONF_SYNC_INTERVAL: Final = "sync_interval" CONF_DELIVERY_METHOD: Final = "delivery_method" CONF_STAMP_COST: Final = "stamp_cost" CONF_LOGLEVEL: Final = "loglevel" +CONF_GREETING: Final = "greeting" # --------------------------------------------------------------------------- # Defaults diff --git a/custom_components/reticulum/manifest.json b/custom_components/reticulum/manifest.json index d291895..d647ccd 100644 --- a/custom_components/reticulum/manifest.json +++ b/custom_components/reticulum/manifest.json @@ -12,5 +12,5 @@ "loggers": ["RNS", "LXMF"], "requirements": ["rns>=0.9.0", "lxmf>=0.6.0"], "single_config_entry": true, - "version": "1.0.7" + "version": "1.0.8" } diff --git a/custom_components/reticulum/strings.json b/custom_components/reticulum/strings.json index 181b615..07fa6ac 100644 --- a/custom_components/reticulum/strings.json +++ b/custom_components/reticulum/strings.json @@ -37,6 +37,7 @@ "allow_all_senders": "Reply to any sender", "allowed_identities": "Allowed sender addresses", "default_recipient": "Default recipient address (for the notify entity)", + "greeting": "Auto-reply message (when Assist is off)", "delivery_method": "Default delivery method", "announce_interval": "Announce interval", "propagation_node": "Propagation node address", @@ -47,6 +48,7 @@ "enable_assist": "When enabled, incoming LXMF messages are answered by the Assist conversation agent and the reply is sent back over Reticulum.", "allowed_identities": "One address per line (or comma separated). Only used when 'Reply to any sender' is off.", "default_recipient": "16-byte hex LXMF address that the notify.reticulum entity sends to.", + "greeting": "Sent as an automatic reply to incoming messages only when 'Route incoming messages to Assist' is turned off. Leave blank to disable.", "announce_interval": "How often (seconds) to announce our address. 0 disables periodic announces.", "propagation_node": "Optional LXMF propagation node for store-and-forward delivery.", "sync_interval": "How often (seconds) to pull queued messages from the propagation node. 0 disables." diff --git a/custom_components/reticulum/translations/en.json b/custom_components/reticulum/translations/en.json index 181b615..07fa6ac 100644 --- a/custom_components/reticulum/translations/en.json +++ b/custom_components/reticulum/translations/en.json @@ -37,6 +37,7 @@ "allow_all_senders": "Reply to any sender", "allowed_identities": "Allowed sender addresses", "default_recipient": "Default recipient address (for the notify entity)", + "greeting": "Auto-reply message (when Assist is off)", "delivery_method": "Default delivery method", "announce_interval": "Announce interval", "propagation_node": "Propagation node address", @@ -47,6 +48,7 @@ "enable_assist": "When enabled, incoming LXMF messages are answered by the Assist conversation agent and the reply is sent back over Reticulum.", "allowed_identities": "One address per line (or comma separated). Only used when 'Reply to any sender' is off.", "default_recipient": "16-byte hex LXMF address that the notify.reticulum entity sends to.", + "greeting": "Sent as an automatic reply to incoming messages only when 'Route incoming messages to Assist' is turned off. Leave blank to disable.", "announce_interval": "How often (seconds) to announce our address. 0 disables periodic announces.", "propagation_node": "Optional LXMF propagation node for store-and-forward delivery.", "sync_interval": "How often (seconds) to pull queued messages from the propagation node. 0 disables." diff --git a/custom_components/reticulum/translations/ru.json b/custom_components/reticulum/translations/ru.json index aef0faf..637be94 100644 --- a/custom_components/reticulum/translations/ru.json +++ b/custom_components/reticulum/translations/ru.json @@ -37,6 +37,7 @@ "allow_all_senders": "Отвечать любому отправителю", "allowed_identities": "Разрешённые адреса отправителей", "default_recipient": "Адрес получателя по умолчанию (для сущности notify)", + "greeting": "Автоответ (когда Assist выключен)", "delivery_method": "Способ доставки по умолчанию", "announce_interval": "Интервал анонсов", "propagation_node": "Адрес узла ретрансляции (propagation node)", @@ -47,6 +48,7 @@ "enable_assist": "Если включено, входящие сообщения LXMF обрабатываются агентом Assist, а ответ отправляется обратно через Reticulum.", "allowed_identities": "По одному адресу в строке (или через запятую). Используется только если «Отвечать любому отправителю» выключено.", "default_recipient": "16-байтовый hex-адрес LXMF, на который отправляет сущность notify.reticulum.", + "greeting": "Отправляется автоматически в ответ на входящие сообщения только когда «Направлять входящие сообщения в Assist» выключено. Оставьте пустым, чтобы отключить.", "announce_interval": "Как часто (в секундах) анонсировать наш адрес. 0 отключает периодические анонсы.", "propagation_node": "Необязательный узел ретрансляции LXMF для доставки по принципу store-and-forward.", "sync_interval": "Как часто (в секундах) забирать сообщения из очереди узла ретрансляции. 0 отключает."