Skip to content

Releases: sfox38/LINE_HA_bot

LINE Bot v1.0.4

Choose a tag to compare

@sfox38 sfox38 released this 05 Jul 05:31
a1e673d

v1.0.4

  • Correct minimum Home Assistant version: hacs.json declared 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-Signature check 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_message with 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 to services.py, and the quota coordinator to coordinator.py. __init__.py now contains only setup, teardown, and runtime data. Shared device info lives in entity.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 just nerd.
  • Cleanup: Removed an unreachable try/except in the name sanitizer and an unused logger in notify.py; single LineBot class-name prefix throughout; from __future__ import annotations and typed user_input parameters everywhere; @callback on the send-failed event helper; fixed the quota sensor entity IDs documented in the README.

v1.0.3

Choose a tag to compare

@sfox38 sfox38 released this 20 Jun 09:55

v1.0.3

  • Pending captures moved to a dedicated Store: Captured-but-unconfirmed senders are now persisted with homeassistant.helpers.storage.Store instead 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]), ConfigFlowResult flow 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 hass reference on the notify entity.
  • MESA: Added mesa_profile.json

v1.0.2

Choose a tag to compare

@sfox38 sfox38 released this 13 Jun 00:57
a8e4f93

Changelog

1.0.2

  • Reply-then-push fallback: reply_token now 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 ASCII recipient_name field (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: true added to manifest, preventing duplicate integration entries.
  • iot_class corrected to cloud_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__.py and notify.py.
  • Sensor improvements: Quota coordinator now passes config_entry= to DataUpdateCoordinator; quota and consumption fetched in parallel; both sensors marked EntityCategory.DIAGNOSTIC; unlimited plans correctly report None for 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_TOKEN constant used to filter LINE's internal test events.
  • CONFIG_SCHEMA set to cv.config_entry_only_config_schema(DOMAIN) per HA standards.
  • hacs.json cleaned up (removed invalid domains and category keys).
  • Various bug fixes and code quality improvements throughout.

v1.0.1

Choose a tag to compare

@sfox38 sfox38 released this 01 May 04:38
87e5bfc

General bug fixes plus improved translations

v1.0.0

Choose a tag to compare

@sfox38 sfox38 released this 31 Mar 09:12
80f46bd

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_message for simple text, and line_ha_bot.send_message for the full feature set.
  • Trigger HA automations from incoming LINE messages via the line_bot_message_received event.
  • 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.