Releases: sfox38/LINE_HA_bot
Releases · sfox38/LINE_HA_bot
Release list
LINE Bot v1.0.4
v1.0.4
- Correct minimum Home Assistant version:
hacs.jsondeclared 2024.11, but the code now uses APIs introduced in HA 2025.3 (AddConfigEntryEntitiesCallback). The minimum is now 2025.3, so HACS will no longer offer the integration to instances that cannot load it. - Quota outage no longer blocks messaging: The quota coordinator is now created during entry setup with a plain first refresh. If LINE's quota API is unreachable at startup, the diagnostic sensors report unavailable and the notify entities load normally, instead of the whole integration going into setup-retry.
- Webhook signature verified first: When the integration is configured, the
X-Line-Signaturecheck now happens before the request body is parsed, so forged requests are rejected with one constant-time HMAC compare. This also means the Verify button now fails when the Channel Secret is wrong, surfacing the misconfiguration immediately (see Troubleshooting). Repeated signature failures log at debug level after the first warning to prevent log flooding. - "Clear all pending" is now translated: The dropdown sentinel uses a selector translation key, so it appears in the UI language (previously it was always English and did not match the label the step description referred to).
- Concurrent sends:
line_ha_bot.send_messagewith multiple targets now sends to all recipients concurrently instead of one after another. Reply-token handling is unchanged: the token is spent on the first resolvable target, with push fallback on failure. - One reload per options session: Adding several recipients with "Add another" now writes the config entry once at the end of the flow instead of once per recipient, triggering a single reload. Abandoning the flow midway no longer discards captured senders - they stay in the pending list.
- Module split: The webhook view moved to
webhook.py, the send service and message builder toservices.py, and the quota coordinator tocoordinator.py.__init__.pynow contains only setup, teardown, and runtime data. Shared device info lives inentity.py. - Emoji name suggestions: Emoji followed by a variation selector (how most keyboards emit them) no longer produce suggestions like
nerd_variation; the selector is dropped and the suggestion is justnerd. - Cleanup: Removed an unreachable
try/exceptin the name sanitizer and an unused logger innotify.py; singleLineBotclass-name prefix throughout;from __future__ import annotationsand typeduser_inputparameters everywhere;@callbackon the send-failed event helper; fixed the quota sensor entity IDs documented in the README.
v1.0.3
v1.0.3
- Pending captures moved to a dedicated Store: Captured-but-unconfirmed senders are now persisted with
homeassistant.helpers.storage.Storeinstead of inside the config entry data. They still survive restarts, and any captures saved by an earlier version are migrated automatically on first load. This removes the config-entry write on every webhook capture, along with the snapshot/skip-reload machinery that existed only to compensate for it. - Simplified reload listener: With pending captures no longer in entry data, the update listener reloads on any credential or recipient change without the previous change-detection snapshot.
- Reload-safe options spinner: The "waiting for message" event now lives in
hass.data, so it survives a config entry reload. The add-recipient wait was rewritten as a single bounded wait (the old 300-cycle polling fallback is gone) and no longer leaves a background task lingering. - Store cleanup on removal: Removing the integration now deletes its pending-captures store file via
async_remove_entry. - Concurrent display-name lookups: When one webhook request carries several new senders, their LINE display names are fetched concurrently rather than one after another.
- Lazy entity-registry lookup: The webhook only scans the entity registry when an event actually maps to a known recipient.
- Modernized typing: Typed config entry runtime data (
ConfigEntry[LineBotRuntimeData]),ConfigFlowResultflow returns,AddConfigEntryEntitiesCallback, and a typed quota coordinator and sensors. - Cleanup: Removed an unused config-entry type alias and an inert selector translation key, fixed import ordering, and dropped a redundant
hassreference on the notify entity. - MESA: Added mesa_profile.json
v1.0.2
Changelog
1.0.2
- Reply-then-push fallback:
reply_tokennow attempts the free Reply API for the first target and automatically falls back to the Push API on failure. Remaining targets always use Push. - Pending user cap: Webhook capture is now capped at 20 pending accounts (FIFO). Oldest entry is evicted when the cap is reached.
- Entity IDs from
recipient_name: Notify entity IDs are now derived from the ASCIIrecipient_namefield (notify.line_bot_<recipient_name>), not the display name. - Confirm checkbox in setup: The webhook setup step now requires ticking a confirmation checkbox before proceeding.
- Event-driven options flow: The "waiting for message" spinner now wakes immediately when a new account is captured, instead of polling on a fixed interval.
- Two-step add-recipient flow: Account selection and name entry are now separate steps, making multi-account adds clearer.
single_config_entry: trueadded to manifest, preventing duplicate integration entries.iot_classcorrected tocloud_push(webhook is the primary data path).- Service registered once at integration level instead of per config entry.
- Shared API helpers extracted to
api.py, eliminating duplicated HTTP logic across__init__.pyandnotify.py. - Sensor improvements: Quota coordinator now passes
config_entry=toDataUpdateCoordinator; quota and consumption fetched in parallel; both sensors markedEntityCategory.DIAGNOSTIC; unlimited plans correctly reportNonefor limit instead of 0. - Webhook robustness: Validates payload structure before processing; room events are explicitly skipped; one config entry write per request instead of per event;
LINE_TEST_REPLY_TOKENconstant used to filter LINE's internal test events. CONFIG_SCHEMAset tocv.config_entry_only_config_schema(DOMAIN)per HA standards.hacs.jsoncleaned up (removed invaliddomainsandcategorykeys).- Various bug fixes and code quality improvements throughout.
v1.0.1
v1.0.0
Version 1.0.0
Features
- Send text, images, audio, video, stickers, locations, flex cards, and button/confirm templates to LINE users and groups.
- Two send interfaces: standard
notify.send_messagefor simple text, andline_ha_bot.send_messagefor the full feature set. - Trigger HA automations from incoming LINE messages via the
line_bot_message_receivedevent. - Reply to incoming messages using LINE's free Reply API via reply tokens.
- Group chat support: add a LINE group as a recipient and send to or receive from the whole group.
- Webhook-based recipient discovery: message the bot and it appears automatically in the setup flow.
- Monthly quota sensors showing message limit and consumption.
- Error events (
line_bot_send_failed) for failed sends, enabling retry or alert automations. - Quick reply chips on any message type, giving recipients one-tap response options.
- Full UI configuration. No YAML required.
- Lightweight, does not depend on any external libraries
- Signature-verified webhook for security.