Repository navigation
Releases: raphael1688dev/lifesmart_local_APP
Releases · raphael1688dev/lifesmart_local_APP
Release list
20261009r0
Review against Home Assistant Core 2026.10.0 (dev blog 2026-08-31 → 09-30, release notes, and every report_usage in the helpers this integration touches). Nothing in 2026.10 breaks the integration; this release ships the follow-ups found during the review.
Fixes
- Config flow no longer crashes on a malformed token or host.
validate_host/validate_tokenraisevol.Invalid, which is not aValueError, so the error escaped the flow and the UI showed "Unknown error occurred". Field-levelinvalid_host/invalid_tokenmessages (already translated in en / zh-Hant / zh-Hans) are now shown instead. An empty host is also rejected. - Hub
sw_versionis coerced tostr. The LifeSmart spec gives no type forcfg:getver'sver; HA's device registry warns on non-string values today and rejects them from 2026.12.0. async_migrate_entryraisesConfigEntryNotReadywhen the hub is unreachable, so HA retries the migration (SETUP_RETRY) instead of marking the entry migrated and relying on the idempotent re-run.
Naming (HA 2026.5 convention)
has_entity_name = Trueon every device-attached entity. Cover and remote are their device's main entity and now carry no name of their own. Displayed names and entity_ids do not change for existing installs; user-set names are kept.
CI
- Tests now run on Python 3.14 — the only interpreter HA 2026.5+ supports. The previous 3.12 / 3.13 matrix never exercised the real runtime.
- 64 tests (28 new for the config-flow validators).
Requires HA 2026.5.0+ (unchanged).
20260913r1
修正(全面自我審查後)
_migrate_entity_ids大寫處理錯誤:原本消毒前沒先轉小寫,大寫字母被當非法字元換成_。混合大小寫的舊 entity_id(例remote.tv_AzQAAPWwAAEAAA8-Gqz_7D01)會被打爛成remote.tv_z_w_8_qz_7_01,HA 的 rename hook 會連自動化引用一起改掉。發生機率低(本整合從未寫入大寫 entity_id,只有 R10-b 之前的舊安裝直接跳到20260803r0+ 才會碰到),但後果嚴重。現在先.lower()再消毒,與generate_entity_id同序。- hub 裝置的
sw_version不再被清空:先前cfg:getver失敗的那次開機會把None寫進 hub 裝置,清掉上次存的韌體版本。現在版本未知時就不傳這個欄位。三處一併修(__init__.py、hub 版本 sensor、hub reboot button)。 - switch.py 的
hub_device_id參數補型別標註。
測試
36 tests passed(原 34 + 新 2 regression)。CI 6 jobs 全綠。
20260913r0
修正
remote.pyentity_id 消毒:_slugify原本只套在裝置名稱上,agt(hub ID)原樣塞入 entity_id。部分 hub 的agt含-(base64-ish token),會產生 HA 2026.8 warn / 2027.2 reject 的 entity_id — 與20260803r0修的是同一類問題,該版漏掉了這個檔。現在整個<name>_<agt>_<me>都經過_slugify。- 對
agt本來就乾淨的使用者,輸出逐字元相同,entity_id 不會搬動。只有帶-的會變_,registry 端由既有的_migrate_entity_ids處理。 - 順帶消除 remote setup 的 in-place rename 與
_migrate_entity_ids每次開機互相改回去的問題。
HA 2026.9 / 2026.9.1 相容性
本版起因於對 HA 2026.9.1 的影響檢查 — 結論:無需為 2026.9 做任何變更。逐項對照 2026.9 backward-incompatible 清單、2026.9.1 patch、以及 8/24 device registry follow-up deprecations,並對 2026.9.1 tag 原始碼驗證 via_device_id / EntityRegistry.entities / PERCENTAGE 均未受影響。
測試
34 tests passed(原 29 + 新 5)。CI 6 jobs 全綠。
20260803r1
新增
- Hub → 子裝置階層(D22):HA UI 的裝置頁現在會把子裝置掛在 hub 底下,不再是一堆平鋪的無主裝置。
實作細節
__init__.py在 forward platforms 之前向 device registry 註冊 hub device,並把 registry ID 存進entry_data— 同時消除了「platforms 並行 setup 時子裝置可能搶先註冊」的順序競態。- 5 個平台(sensor / switch / cover / binary_sensor / remote)在
DeviceInfo設via_device_id。 - 刻意不用
via_device=(DOMAIN, identifier):HA 2026.8 起 identifiers 只在單一 config entry 內唯一,identifier tuple 不再能無歧義指向單一裝置,該參數已 deprecated(同時傳兩者會 raise,2027.8 移除)。
測試
29 tests passed。CI 6 jobs 全綠。
20260803r0
修正
entity_id合規化:HA entity_id object 部分只允許[a-z0-9_],部分 hub 的agt包含-(base64-ish token),會產生 HA 2026 warn / 2027.2 reject 的 entity_id。generate_entity_id現在會把非法字元換_再 collapse。- 自動遷移舊 entity_id:
_migrate_entity_ids在 setup 時掃 entity registry,把已註冊的foo-bar型別 in-place 改成foo_bar。HA 會自動更新自動化 / 腳本的引用;Lovelace card 為使用者手寫 YAML,需自行更新。 - Idempotent — 每次 setup 都跑一次,已合規的 id 直接跳過。
測試
29 tests passed(原 21 + 新 8)。
20260601r1
Install via HACS
- HACS → Integrations → ⋮ → Custom repositories → add
https://github.com/raphael1688dev/lifesmart_local_APP(category: Integration) - Install Local LifeSmart, restart Home Assistant
- Settings → Devices & Services → Add Integration → Local LifeSmart
What's included
Sub-device platforms
switch— Stellar/Starry/Polar Switch (SL_SW_ND*), Moonstone Switch (SL_SW_NS*), Traditional Switch (SL_SW_IF*/SL_SW_RC), Nature Mini (SL_NATUREas switch)sensor— temperature (SL_NATURE), battery (SL_PcurtainP8;SL_SW_ND*/SL_MC_ND*Vper spec §6.3.2 / §6.3.5), per-device signal strength (lDbmcommon attribute, §6.1)binary_sensor— per-device connectivity (statcommon attribute) with push (NOTIFY) + 15 min fallback pollcover—SL_PMINS Curtain Motor Controllerremote— IR remote (SPOT)
Hub-level platforms
sensor— 3 hub-info diagnostic sensors (firmware version, OS version, model — viacfg:getver)button— hub reboot (cfg:reboot,ButtonDeviceClass.RESTART)scene— auto-discovered hub scenes (cls in ('scene', 'groupirc'))
Architecture
DataUpdateCoordinator— singleepsper cycle for sensor polling (replaces per-entity timer)- Push state listener for instant updates from NOTIFY, orthogonal to coordinator
- Cross-hub safe unique_id (
<feature>_<agt>_<me>) with in-place migration viaasync_migrate_entry - Auto event-service re-subscription every 90 s (spec requires within 300 s)
Quality of life
- Diagnostics platform — download full entry/device payload from HA UI (token redacted)
- Repair Issues — actionable failures surface in HA Repairs panel
- pytest suite (21 tests, no HA install required — CI runs on Python 3.12 + 3.13)
- HA 2026.5 compliant entity naming (
DeviceInfo.name+ function-only_attr_name) - Translations: English, 繁體中文, 简体中文
- CI: pytest matrix + py_compile + JSON validation + HACS + hassfest, all green
⚠ Known limitations
coverP1 status channel is not implementation-verified (spec §6.9.1 ambiguous)- Scene trigger
args.args.type=128copied from spec example, not tested across cls - Hub-level
rssi(nome) not yet implemented — spec wording ambiguous binary_sensorandcoverstill use per-entity polling; coordinator is wired but not yet consumed by them
Generated with Claude Code