Config export/import: tame_vendor_packages never exported; fleet mode skips preference keys same-hardware fleets need; fleet-credentials recipe undocumented

オープン
#48 コメント 3 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
28/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
android, kotlin

調査の方向性

Read SettingsRegistry.kt and Config.kt to trace why tame_vendor_packages is absent from exports, then inspect fleet import scope handling and docs/provisioning.md. The issue raises three separate outcomes: register the setting with an agreed scope, decide whether profile-matched fleet imports apply non-secret device keys, and document fleet provisioning with explicit credential flags and per-panel --id.

索引モデルが issue の本文から書いたものです。

説明

While deploying a 16-panel NSPanel Pro fleet from one panel's --export bundle (same context as #46 / #47), a freshly provisioned panel came up visibly barer than the source panel even after --restore-fleet reported success. Comparing the two panels' full /api/v1/config key-by-key surfaced three distinct findings — one bug, one design question, one docs gap.

1. Bug: tame_vendor_packages is missing from every export bundle

tame_vendor_packages exists in Config.kt and is settable via POST /api/v1/config, but it is not registered in SettingsRegistry.kt — so it never travels in an export bundle. Consequences:

  • Full same-panel --restore (the disaster-recovery / like-for-like-replacement path) silently loses the tame list — the replacement panel comes back with the vendor apps untamed and nothing reports the drop.
  • Fleet deployments have no way to carry it at all; each panel must be re-tamed by hand.

This looks like an omission rather than a scope decision. Happy to PR the registration if you confirm which scope you'd want (DEVICE fixes the restore loss; arguably it is PORTABLE, since taming is a no-op for package names that aren't present on the target).

2. Design question: DEVICE-scoped keys that same-hardware fleets want cloned

import?mode=fleet applies only Scope.PORTABLE, and SettingSpec's scope defaults to DEVICE, so preference-like keys sit in the skip pile. Deploying nsp1's bundle to an identical panel skipped, among others:

key source panel fresh panel after fleet restore
navbar_mode Swipe reveal Off
self_update on off
silence_boot_chime on off
zigbee_router on off
manufacturer / model Sonoff / NS Panel Pro empty

For a mixed-hardware fleet the conservative default makes sense (e.g. zigbee_router on a panel without the radio). But for the common case — N identical panels — the operator ends up hand-applying these per panel via the config API.

Suggestion: since both the bundle and the live panel know their hardware profile id (e.g. nspanel-pro@26b9e6493565), the import endpoint could support a profile-matched fleet mode that also applies non-secret DEVICE keys when the source and target profiles match, keeping today's behavior when they differ. Alternatively (or additionally), some of the above may simply deserve PORTABLE. zigbee_router has one extra wrinkle worth noting for any future auto-apply: it acts like an action (starts the vendor gateway), and in my testing a value batched together with other settings could get lost across the settings restart — applying it separately with a verify/retry was reliable.

3. Docs gap: fleet deployments with shared credentials

--restore-fleet correctly never carries secrets, and provision.sh already has the right explicit channels (--ha-token, --mqtt-user, --mqtt-pass). But the combination isn't spelled out anywhere: a fleet bootstrapped from an export bundle alone comes up with MQTT discovered-but-auth-failed, which looks like a broker problem rather than a deliberately-skipped secret. A short "deploying a fleet from one panel's export" recipe in docs/provisioning.md — bundle for portable settings, explicit flags for the shared secrets, per-panel --id — would have saved me a diagnosis round.

I have the 16-panel fleet available to test any of the above; happy to send PRs for whichever directions you'd take.

主要言語
Kotlin
スター
63
フォーク
5
平均マージ
1日 5時間
マージ済み PR(30日)
11

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

panel-assistant/android のほかの issue

panel-assistant/android の issue をすべて見る

似ている issue

Kotlin の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。