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 <noreply@anthropic.com>
88 lines
3.5 KiB
Python
88 lines
3.5 KiB
Python
"""Constants for the Reticulum integration."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Final
|
|
|
|
DOMAIN: Final = "reticulum"
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Configuration keys
|
|
# ---------------------------------------------------------------------------
|
|
CONF_TARGET_HOST: Final = "target_host"
|
|
CONF_TARGET_PORT: Final = "target_port"
|
|
CONF_INTERFACE_NAME: Final = "interface_name"
|
|
CONF_DISPLAY_NAME: Final = "display_name"
|
|
|
|
# Options
|
|
CONF_ENABLE_ASSIST: Final = "enable_assist"
|
|
CONF_ASSIST_AGENT: Final = "assist_agent"
|
|
CONF_ASSIST_LANGUAGE: Final = "assist_language"
|
|
CONF_ALLOWED_IDENTITIES: Final = "allowed_identities"
|
|
CONF_ALLOW_ALL: Final = "allow_all_senders"
|
|
CONF_DEFAULT_RECIPIENT: Final = "default_recipient"
|
|
CONF_ANNOUNCE_INTERVAL: Final = "announce_interval"
|
|
CONF_PROPAGATION_NODE: Final = "propagation_node"
|
|
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
|
|
# ---------------------------------------------------------------------------
|
|
DEFAULT_INTERFACE_NAME: Final = "HA TCP Client"
|
|
DEFAULT_DISPLAY_NAME: Final = "Home Assistant"
|
|
DEFAULT_TARGET_PORT: Final = 4242
|
|
DEFAULT_ANNOUNCE_INTERVAL: Final = 1800 # seconds; 0 disables periodic announce
|
|
DEFAULT_SYNC_INTERVAL: Final = 0 # seconds; 0 disables propagation-node sync
|
|
DEFAULT_DELIVERY_METHOD: Final = "direct"
|
|
DEFAULT_STAMP_COST: Final = 0
|
|
DEFAULT_LOGLEVEL: Final = 3 # RNS.LOG_NOTICE
|
|
|
|
DELIVERY_METHODS: Final = ["direct", "opportunistic", "propagated"]
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Storage
|
|
# ---------------------------------------------------------------------------
|
|
STORAGE_SUBDIR: Final = "reticulum"
|
|
IDENTITY_FILENAME: Final = "identity"
|
|
CONFIG_FILENAME: Final = "config"
|
|
ATTACHMENTS_SUBDIR: Final = "attachments"
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Dispatcher signals
|
|
# ---------------------------------------------------------------------------
|
|
SIGNAL_STATE_UPDATED: Final = f"{DOMAIN}_state_updated"
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Events
|
|
# ---------------------------------------------------------------------------
|
|
EVENT_MESSAGE_RECEIVED: Final = f"{DOMAIN}_message_received"
|
|
EVENT_MESSAGE_DELIVERED: Final = f"{DOMAIN}_message_delivered"
|
|
EVENT_MESSAGE_FAILED: Final = f"{DOMAIN}_message_failed"
|
|
EVENT_ANNOUNCE_RECEIVED: Final = f"{DOMAIN}_announce_received"
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# Services
|
|
# ---------------------------------------------------------------------------
|
|
SERVICE_SEND_MESSAGE: Final = "send_message"
|
|
SERVICE_ANNOUNCE: Final = "announce"
|
|
SERVICE_REQUEST_PATH: Final = "request_path"
|
|
SERVICE_SYNC_PROPAGATION: Final = "sync_propagation"
|
|
SERVICE_SET_PROPAGATION_NODE: Final = "set_propagation_node"
|
|
|
|
ATTR_DESTINATION: Final = "destination"
|
|
ATTR_CONTENT: Final = "content"
|
|
ATTR_TITLE: Final = "title"
|
|
ATTR_METHOD: Final = "method"
|
|
ATTR_FIELDS: Final = "fields"
|
|
ATTR_MAX_MESSAGES: Final = "max_messages"
|
|
|
|
# ---------------------------------------------------------------------------
|
|
# LXMF address geometry
|
|
# ---------------------------------------------------------------------------
|
|
# Reticulum truncated destination hashes are 16 bytes -> 32 hex chars.
|
|
DEST_HASH_LEN: Final = 32
|