homebridge-multiple-switch 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/config.schema.json +1 -0
- package/homebridge-ui/public/i18n/ar.json +29 -0
- package/homebridge-ui/public/i18n/de.json +29 -0
- package/homebridge-ui/public/i18n/en.json +29 -0
- package/homebridge-ui/public/i18n/es.json +29 -0
- package/homebridge-ui/public/i18n/fr.json +29 -0
- package/homebridge-ui/public/i18n/it.json +29 -0
- package/homebridge-ui/public/i18n/ja.json +29 -0
- package/homebridge-ui/public/i18n/ko.json +29 -0
- package/homebridge-ui/public/i18n/nl.json +29 -0
- package/homebridge-ui/public/i18n/pl.json +29 -0
- package/homebridge-ui/public/i18n/pt.json +29 -0
- package/homebridge-ui/public/i18n/ru.json +29 -0
- package/homebridge-ui/public/i18n/tr.json +29 -0
- package/homebridge-ui/public/i18n/zh-CN.json +29 -0
- package/homebridge-ui/public/index.html +187 -0
- package/package.json +1 -1
- package/i18n/ar.json +0 -46
- package/i18n/de.json +0 -46
- package/i18n/en.json +0 -46
- package/i18n/es.json +0 -46
- package/i18n/fr.json +0 -46
- package/i18n/it.json +0 -46
- package/i18n/ja.json +0 -46
- package/i18n/ko.json +0 -46
- package/i18n/nl.json +0 -46
- package/i18n/pl.json +0 -46
- package/i18n/pt.json +0 -46
- package/i18n/ru.json +0 -46
- package/i18n/tr.json +0 -46
- package/i18n/zh-CN.json +0 -46
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.3.2] - 2026-03-21
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
- Replaced static i18n folder with Custom UI (`homebridge-ui/public/`) using
|
|
7
|
+
`homebridge.i18nCurrentLang()` for proper language detection
|
|
8
|
+
- Plugin config UI now renders a fully localized form that matches the
|
|
9
|
+
Homebridge UI language setting
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
- i18n translations not being applied (Homebridge does not support automatic
|
|
13
|
+
schema-level i18n; Custom UI is required)
|
|
14
|
+
|
|
3
15
|
## [1.3.1] - 2026-03-21
|
|
4
16
|
|
|
5
17
|
### Added
|
package/config.schema.json
CHANGED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": "منصة المفاتيح المتعددة",
|
|
3
|
+
"platformName": "اسم المنصة",
|
|
4
|
+
"platformNameDesc": "اسم هذا المثيل من المنصة في HomeKit.",
|
|
5
|
+
"switchBehavior": "وضع سلوك المفتاح",
|
|
6
|
+
"switchBehaviorDesc": "يتحكم في كيفية تفاعل المفاتيح مع بعضها البعض.",
|
|
7
|
+
"behaviorIndependent": "مستقل",
|
|
8
|
+
"behaviorMaster": "رئيسي",
|
|
9
|
+
"behaviorSingle": "فردي",
|
|
10
|
+
"switches": "المفاتيح",
|
|
11
|
+
"switchesDesc": "قائمة المفاتيح الافتراضية المراد إنشاؤها.",
|
|
12
|
+
"switchName": "اسم المفتاح",
|
|
13
|
+
"switchNameDesc": "اسم العرض للمفتاح في HomeKit.",
|
|
14
|
+
"switchType": "نوع المفتاح",
|
|
15
|
+
"switchTypeDesc": "نوع ملحق HomeKit لهذا المفتاح.",
|
|
16
|
+
"typeSwitch": "مفتاح",
|
|
17
|
+
"typeOutlet": "مقبس",
|
|
18
|
+
"typeLightbulb": "مصباح",
|
|
19
|
+
"typeFan": "مروحة",
|
|
20
|
+
"defaultState": "الحالة الافتراضية",
|
|
21
|
+
"defaultStateDesc": "حالة الطاقة الأولية عند بدء تشغيل Homebridge.",
|
|
22
|
+
"delayOff": "إيقاف تلقائي (مللي ثانية)",
|
|
23
|
+
"delayOffDesc": "يتم الإيقاف تلقائيًا بعد هذا العدد من المللي ثانية. اضبط على 0 للتعطيل.",
|
|
24
|
+
"addSwitch": "إضافة مفتاح",
|
|
25
|
+
"removeSwitch": "إزالة",
|
|
26
|
+
"save": "حفظ",
|
|
27
|
+
"on": "تشغيل",
|
|
28
|
+
"off": "إيقاف"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": "Mehrfachschalter-Plattform",
|
|
3
|
+
"platformName": "Plattformname",
|
|
4
|
+
"platformNameDesc": "Der Name dieser Plattforminstanz in HomeKit.",
|
|
5
|
+
"switchBehavior": "Schaltverhalten",
|
|
6
|
+
"switchBehaviorDesc": "Steuert, wie die Schalter miteinander interagieren.",
|
|
7
|
+
"behaviorIndependent": "Unabhängig",
|
|
8
|
+
"behaviorMaster": "Master",
|
|
9
|
+
"behaviorSingle": "Einzeln",
|
|
10
|
+
"switches": "Schalter",
|
|
11
|
+
"switchesDesc": "Liste der zu erstellenden virtuellen Schalter.",
|
|
12
|
+
"switchName": "Schaltername",
|
|
13
|
+
"switchNameDesc": "Anzeigename des Schalters in HomeKit.",
|
|
14
|
+
"switchType": "Schaltertyp",
|
|
15
|
+
"switchTypeDesc": "Der HomeKit-Zubehörtyp für diesen Schalter.",
|
|
16
|
+
"typeSwitch": "Schalter",
|
|
17
|
+
"typeOutlet": "Steckdose",
|
|
18
|
+
"typeLightbulb": "Glühbirne",
|
|
19
|
+
"typeFan": "Ventilator",
|
|
20
|
+
"defaultState": "Standardzustand",
|
|
21
|
+
"defaultStateDesc": "Anfänglicher Energiezustand beim Start von Homebridge.",
|
|
22
|
+
"delayOff": "Automatisch ausschalten (ms)",
|
|
23
|
+
"delayOffDesc": "Schaltet nach dieser Anzahl von Millisekunden automatisch aus. Zum Deaktivieren auf 0 setzen.",
|
|
24
|
+
"addSwitch": "Schalter hinzufügen",
|
|
25
|
+
"removeSwitch": "Entfernen",
|
|
26
|
+
"save": "Speichern",
|
|
27
|
+
"on": "Ein",
|
|
28
|
+
"off": "Aus"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": "Multiple Switch Platform",
|
|
3
|
+
"platformName": "Platform Name",
|
|
4
|
+
"platformNameDesc": "The name of this platform instance in HomeKit.",
|
|
5
|
+
"switchBehavior": "Switch Behavior Mode",
|
|
6
|
+
"switchBehaviorDesc": "Controls how switches interact with each other.",
|
|
7
|
+
"behaviorIndependent": "Independent",
|
|
8
|
+
"behaviorMaster": "Master",
|
|
9
|
+
"behaviorSingle": "Single",
|
|
10
|
+
"switches": "Switches",
|
|
11
|
+
"switchesDesc": "List of virtual switches to create.",
|
|
12
|
+
"switchName": "Switch Name",
|
|
13
|
+
"switchNameDesc": "Display name of the switch in HomeKit.",
|
|
14
|
+
"switchType": "Switch Type",
|
|
15
|
+
"switchTypeDesc": "The HomeKit accessory type for this switch.",
|
|
16
|
+
"typeSwitch": "Switch",
|
|
17
|
+
"typeOutlet": "Outlet",
|
|
18
|
+
"typeLightbulb": "Lightbulb",
|
|
19
|
+
"typeFan": "Fan",
|
|
20
|
+
"defaultState": "Default State",
|
|
21
|
+
"defaultStateDesc": "Initial power state when Homebridge starts.",
|
|
22
|
+
"delayOff": "Auto Turn Off (ms)",
|
|
23
|
+
"delayOffDesc": "Automatically turn off after this many milliseconds. Set to 0 to disable.",
|
|
24
|
+
"addSwitch": "Add Switch",
|
|
25
|
+
"removeSwitch": "Remove",
|
|
26
|
+
"save": "Save",
|
|
27
|
+
"on": "On",
|
|
28
|
+
"off": "Off"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": "Plataforma de Múltiples Interruptores",
|
|
3
|
+
"platformName": "Nombre de la plataforma",
|
|
4
|
+
"platformNameDesc": "El nombre de esta instancia de plataforma en HomeKit.",
|
|
5
|
+
"switchBehavior": "Modo de comportamiento",
|
|
6
|
+
"switchBehaviorDesc": "Controla cómo interactúan los interruptores entre sí.",
|
|
7
|
+
"behaviorIndependent": "Independiente",
|
|
8
|
+
"behaviorMaster": "Maestro",
|
|
9
|
+
"behaviorSingle": "Único",
|
|
10
|
+
"switches": "Interruptores",
|
|
11
|
+
"switchesDesc": "Lista de interruptores virtuales a crear.",
|
|
12
|
+
"switchName": "Nombre del interruptor",
|
|
13
|
+
"switchNameDesc": "Nombre visible del interruptor en HomeKit.",
|
|
14
|
+
"switchType": "Tipo de interruptor",
|
|
15
|
+
"switchTypeDesc": "El tipo de accesorio HomeKit para este interruptor.",
|
|
16
|
+
"typeSwitch": "Interruptor",
|
|
17
|
+
"typeOutlet": "Enchufe",
|
|
18
|
+
"typeLightbulb": "Bombilla",
|
|
19
|
+
"typeFan": "Ventilador",
|
|
20
|
+
"defaultState": "Estado predeterminado",
|
|
21
|
+
"defaultStateDesc": "Estado de energía inicial cuando Homebridge se inicia.",
|
|
22
|
+
"delayOff": "Apagado automático (ms)",
|
|
23
|
+
"delayOffDesc": "Se apaga automáticamente después de estos milisegundos. Establecer en 0 para desactivar.",
|
|
24
|
+
"addSwitch": "Agregar interruptor",
|
|
25
|
+
"removeSwitch": "Eliminar",
|
|
26
|
+
"save": "Guardar",
|
|
27
|
+
"on": "Encendido",
|
|
28
|
+
"off": "Apagado"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": "Plateforme Multi-Interrupteurs",
|
|
3
|
+
"platformName": "Nom de la plateforme",
|
|
4
|
+
"platformNameDesc": "Le nom de cette instance de plateforme dans HomeKit.",
|
|
5
|
+
"switchBehavior": "Mode de comportement",
|
|
6
|
+
"switchBehaviorDesc": "Contrôle la façon dont les interrupteurs interagissent entre eux.",
|
|
7
|
+
"behaviorIndependent": "Indépendant",
|
|
8
|
+
"behaviorMaster": "Maître",
|
|
9
|
+
"behaviorSingle": "Unique",
|
|
10
|
+
"switches": "Interrupteurs",
|
|
11
|
+
"switchesDesc": "Liste des interrupteurs virtuels à créer.",
|
|
12
|
+
"switchName": "Nom de l'interrupteur",
|
|
13
|
+
"switchNameDesc": "Nom affiché de l'interrupteur dans HomeKit.",
|
|
14
|
+
"switchType": "Type d'interrupteur",
|
|
15
|
+
"switchTypeDesc": "Le type d'accessoire HomeKit pour cet interrupteur.",
|
|
16
|
+
"typeSwitch": "Interrupteur",
|
|
17
|
+
"typeOutlet": "Prise",
|
|
18
|
+
"typeLightbulb": "Ampoule",
|
|
19
|
+
"typeFan": "Ventilateur",
|
|
20
|
+
"defaultState": "État par défaut",
|
|
21
|
+
"defaultStateDesc": "État d'alimentation initial au démarrage de Homebridge.",
|
|
22
|
+
"delayOff": "Arrêt automatique (ms)",
|
|
23
|
+
"delayOffDesc": "S'éteint automatiquement après ce nombre de millisecondes. Mettre à 0 pour désactiver.",
|
|
24
|
+
"addSwitch": "Ajouter un interrupteur",
|
|
25
|
+
"removeSwitch": "Supprimer",
|
|
26
|
+
"save": "Enregistrer",
|
|
27
|
+
"on": "Activé",
|
|
28
|
+
"off": "Désactivé"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": "Piattaforma Multi-Interruttore",
|
|
3
|
+
"platformName": "Nome della piattaforma",
|
|
4
|
+
"platformNameDesc": "Il nome di questa istanza della piattaforma in HomeKit.",
|
|
5
|
+
"switchBehavior": "Modalità di comportamento",
|
|
6
|
+
"switchBehaviorDesc": "Controlla come gli interruttori interagiscono tra loro.",
|
|
7
|
+
"behaviorIndependent": "Indipendente",
|
|
8
|
+
"behaviorMaster": "Master",
|
|
9
|
+
"behaviorSingle": "Singolo",
|
|
10
|
+
"switches": "Interruttori",
|
|
11
|
+
"switchesDesc": "Elenco degli interruttori virtuali da creare.",
|
|
12
|
+
"switchName": "Nome dell'interruttore",
|
|
13
|
+
"switchNameDesc": "Nome visualizzato dell'interruttore in HomeKit.",
|
|
14
|
+
"switchType": "Tipo di interruttore",
|
|
15
|
+
"switchTypeDesc": "Il tipo di accessorio HomeKit per questo interruttore.",
|
|
16
|
+
"typeSwitch": "Interruttore",
|
|
17
|
+
"typeOutlet": "Presa",
|
|
18
|
+
"typeLightbulb": "Lampadina",
|
|
19
|
+
"typeFan": "Ventilatore",
|
|
20
|
+
"defaultState": "Stato predefinito",
|
|
21
|
+
"defaultStateDesc": "Stato di alimentazione iniziale all'avvio di Homebridge.",
|
|
22
|
+
"delayOff": "Spegnimento automatico (ms)",
|
|
23
|
+
"delayOffDesc": "Si spegne automaticamente dopo questi millisecondi. Impostare a 0 per disattivare.",
|
|
24
|
+
"addSwitch": "Aggiungi interruttore",
|
|
25
|
+
"removeSwitch": "Rimuovi",
|
|
26
|
+
"save": "Salva",
|
|
27
|
+
"on": "Acceso",
|
|
28
|
+
"off": "Spento"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": "マルチスイッチプラットフォーム",
|
|
3
|
+
"platformName": "プラットフォーム名",
|
|
4
|
+
"platformNameDesc": "HomeKit でのこのプラットフォームインスタンスの名前。",
|
|
5
|
+
"switchBehavior": "スイッチ動作モード",
|
|
6
|
+
"switchBehaviorDesc": "スイッチ同士の相互作用を制御します。",
|
|
7
|
+
"behaviorIndependent": "独立",
|
|
8
|
+
"behaviorMaster": "マスター",
|
|
9
|
+
"behaviorSingle": "シングル",
|
|
10
|
+
"switches": "スイッチ",
|
|
11
|
+
"switchesDesc": "作成する仮想スイッチのリスト。",
|
|
12
|
+
"switchName": "スイッチ名",
|
|
13
|
+
"switchNameDesc": "HomeKit でのスイッチの表示名。",
|
|
14
|
+
"switchType": "スイッチタイプ",
|
|
15
|
+
"switchTypeDesc": "このスイッチの HomeKit アクセサリタイプ。",
|
|
16
|
+
"typeSwitch": "スイッチ",
|
|
17
|
+
"typeOutlet": "コンセント",
|
|
18
|
+
"typeLightbulb": "電球",
|
|
19
|
+
"typeFan": "ファン",
|
|
20
|
+
"defaultState": "デフォルト状態",
|
|
21
|
+
"defaultStateDesc": "Homebridge 起動時の初期電源状態。",
|
|
22
|
+
"delayOff": "自動オフ(ミリ秒)",
|
|
23
|
+
"delayOffDesc": "指定したミリ秒後に自動的にオフになります。無効にするには 0 に設定してください。",
|
|
24
|
+
"addSwitch": "スイッチを追加",
|
|
25
|
+
"removeSwitch": "削除",
|
|
26
|
+
"save": "保存",
|
|
27
|
+
"on": "オン",
|
|
28
|
+
"off": "オフ"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": "멀티 스위치 플랫폼",
|
|
3
|
+
"platformName": "플랫폼 이름",
|
|
4
|
+
"platformNameDesc": "HomeKit에서 이 플랫폼 인스턴스의 이름.",
|
|
5
|
+
"switchBehavior": "스위치 동작 모드",
|
|
6
|
+
"switchBehaviorDesc": "스위치 간의 상호 작용 방식을 제어합니다.",
|
|
7
|
+
"behaviorIndependent": "독립",
|
|
8
|
+
"behaviorMaster": "마스터",
|
|
9
|
+
"behaviorSingle": "단일",
|
|
10
|
+
"switches": "스위치",
|
|
11
|
+
"switchesDesc": "생성할 가상 스위치 목록.",
|
|
12
|
+
"switchName": "스위치 이름",
|
|
13
|
+
"switchNameDesc": "HomeKit에서 스위치의 표시 이름.",
|
|
14
|
+
"switchType": "스위치 유형",
|
|
15
|
+
"switchTypeDesc": "이 스위치의 HomeKit 액세서리 유형.",
|
|
16
|
+
"typeSwitch": "스위치",
|
|
17
|
+
"typeOutlet": "콘센트",
|
|
18
|
+
"typeLightbulb": "전구",
|
|
19
|
+
"typeFan": "팬",
|
|
20
|
+
"defaultState": "기본 상태",
|
|
21
|
+
"defaultStateDesc": "Homebridge 시작 시 초기 전원 상태.",
|
|
22
|
+
"delayOff": "자동 꺼짐 (ms)",
|
|
23
|
+
"delayOffDesc": "지정된 밀리초 후 자동으로 꺼집니다. 비활성화하려면 0으로 설정하세요.",
|
|
24
|
+
"addSwitch": "스위치 추가",
|
|
25
|
+
"removeSwitch": "삭제",
|
|
26
|
+
"save": "저장",
|
|
27
|
+
"on": "켜짐",
|
|
28
|
+
"off": "꺼짐"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": "Meervoudige schakelaar platform",
|
|
3
|
+
"platformName": "Platformnaam",
|
|
4
|
+
"platformNameDesc": "De naam van dit platformexemplaar in HomeKit.",
|
|
5
|
+
"switchBehavior": "Schakelaargedrag",
|
|
6
|
+
"switchBehaviorDesc": "Bepaalt hoe de schakelaars met elkaar omgaan.",
|
|
7
|
+
"behaviorIndependent": "Onafhankelijk",
|
|
8
|
+
"behaviorMaster": "Master",
|
|
9
|
+
"behaviorSingle": "Enkelvoudig",
|
|
10
|
+
"switches": "Schakelaars",
|
|
11
|
+
"switchesDesc": "Lijst van virtuele schakelaars om aan te maken.",
|
|
12
|
+
"switchName": "Schakelaarnaam",
|
|
13
|
+
"switchNameDesc": "Weergavenaam van de schakelaar in HomeKit.",
|
|
14
|
+
"switchType": "Schakelaartype",
|
|
15
|
+
"switchTypeDesc": "Het HomeKit-accessoiretype voor deze schakelaar.",
|
|
16
|
+
"typeSwitch": "Schakelaar",
|
|
17
|
+
"typeOutlet": "Stopcontact",
|
|
18
|
+
"typeLightbulb": "Gloeilamp",
|
|
19
|
+
"typeFan": "Ventilator",
|
|
20
|
+
"defaultState": "Standaardstatus",
|
|
21
|
+
"defaultStateDesc": "Initiële voedingsstatus wanneer Homebridge opstart.",
|
|
22
|
+
"delayOff": "Automatisch uitschakelen (ms)",
|
|
23
|
+
"delayOffDesc": "Schakelt automatisch uit na dit aantal milliseconden. Stel in op 0 om uit te schakelen.",
|
|
24
|
+
"addSwitch": "Schakelaar toevoegen",
|
|
25
|
+
"removeSwitch": "Verwijderen",
|
|
26
|
+
"save": "Opslaan",
|
|
27
|
+
"on": "Aan",
|
|
28
|
+
"off": "Uit"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": "Platforma wielu przełączników",
|
|
3
|
+
"platformName": "Nazwa platformy",
|
|
4
|
+
"platformNameDesc": "Nazwa tej instancji platformy w HomeKit.",
|
|
5
|
+
"switchBehavior": "Tryb zachowania przełączników",
|
|
6
|
+
"switchBehaviorDesc": "Kontroluje sposób interakcji przełączników ze sobą.",
|
|
7
|
+
"behaviorIndependent": "Niezależny",
|
|
8
|
+
"behaviorMaster": "Główny",
|
|
9
|
+
"behaviorSingle": "Pojedynczy",
|
|
10
|
+
"switches": "Przełączniki",
|
|
11
|
+
"switchesDesc": "Lista wirtualnych przełączników do utworzenia.",
|
|
12
|
+
"switchName": "Nazwa przełącznika",
|
|
13
|
+
"switchNameDesc": "Wyświetlana nazwa przełącznika w HomeKit.",
|
|
14
|
+
"switchType": "Typ przełącznika",
|
|
15
|
+
"switchTypeDesc": "Typ akcesorium HomeKit dla tego przełącznika.",
|
|
16
|
+
"typeSwitch": "Przełącznik",
|
|
17
|
+
"typeOutlet": "Gniazdko",
|
|
18
|
+
"typeLightbulb": "Żarówka",
|
|
19
|
+
"typeFan": "Wentylator",
|
|
20
|
+
"defaultState": "Stan domyślny",
|
|
21
|
+
"defaultStateDesc": "Początkowy stan zasilania przy uruchomieniu Homebridge.",
|
|
22
|
+
"delayOff": "Automatyczne wyłączenie (ms)",
|
|
23
|
+
"delayOffDesc": "Automatycznie wyłącza się po podanej liczbie milisekund. Ustaw 0, aby wyłączyć.",
|
|
24
|
+
"addSwitch": "Dodaj przełącznik",
|
|
25
|
+
"removeSwitch": "Usuń",
|
|
26
|
+
"save": "Zapisz",
|
|
27
|
+
"on": "Wł",
|
|
28
|
+
"off": "Wył"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": "Plataforma de Múltiplos Interruptores",
|
|
3
|
+
"platformName": "Nome da plataforma",
|
|
4
|
+
"platformNameDesc": "O nome desta instância de plataforma no HomeKit.",
|
|
5
|
+
"switchBehavior": "Modo de comportamento",
|
|
6
|
+
"switchBehaviorDesc": "Controla como os interruptores interagem entre si.",
|
|
7
|
+
"behaviorIndependent": "Independente",
|
|
8
|
+
"behaviorMaster": "Mestre",
|
|
9
|
+
"behaviorSingle": "Único",
|
|
10
|
+
"switches": "Interruptores",
|
|
11
|
+
"switchesDesc": "Lista de interruptores virtuais a criar.",
|
|
12
|
+
"switchName": "Nome do interruptor",
|
|
13
|
+
"switchNameDesc": "Nome de exibição do interruptor no HomeKit.",
|
|
14
|
+
"switchType": "Tipo de interruptor",
|
|
15
|
+
"switchTypeDesc": "O tipo de acessório HomeKit para este interruptor.",
|
|
16
|
+
"typeSwitch": "Interruptor",
|
|
17
|
+
"typeOutlet": "Tomada",
|
|
18
|
+
"typeLightbulb": "Lâmpada",
|
|
19
|
+
"typeFan": "Ventilador",
|
|
20
|
+
"defaultState": "Estado padrão",
|
|
21
|
+
"defaultStateDesc": "Estado de energia inicial quando o Homebridge inicia.",
|
|
22
|
+
"delayOff": "Desligamento automático (ms)",
|
|
23
|
+
"delayOffDesc": "Desliga automaticamente após estes milissegundos. Defina como 0 para desativar.",
|
|
24
|
+
"addSwitch": "Adicionar interruptor",
|
|
25
|
+
"removeSwitch": "Remover",
|
|
26
|
+
"save": "Salvar",
|
|
27
|
+
"on": "Ligado",
|
|
28
|
+
"off": "Desligado"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": "Платформа мультипереключателей",
|
|
3
|
+
"platformName": "Название платформы",
|
|
4
|
+
"platformNameDesc": "Название этого экземпляра платформы в HomeKit.",
|
|
5
|
+
"switchBehavior": "Режим поведения",
|
|
6
|
+
"switchBehaviorDesc": "Управляет взаимодействием переключателей друг с другом.",
|
|
7
|
+
"behaviorIndependent": "Независимый",
|
|
8
|
+
"behaviorMaster": "Мастер",
|
|
9
|
+
"behaviorSingle": "Одиночный",
|
|
10
|
+
"switches": "Переключатели",
|
|
11
|
+
"switchesDesc": "Список виртуальных переключателей для создания.",
|
|
12
|
+
"switchName": "Название переключателя",
|
|
13
|
+
"switchNameDesc": "Отображаемое имя переключателя в HomeKit.",
|
|
14
|
+
"switchType": "Тип переключателя",
|
|
15
|
+
"switchTypeDesc": "Тип аксессуара HomeKit для этого переключателя.",
|
|
16
|
+
"typeSwitch": "Выключатель",
|
|
17
|
+
"typeOutlet": "Розетка",
|
|
18
|
+
"typeLightbulb": "Лампочка",
|
|
19
|
+
"typeFan": "Вентилятор",
|
|
20
|
+
"defaultState": "Состояние по умолчанию",
|
|
21
|
+
"defaultStateDesc": "Начальное состояние питания при запуске Homebridge.",
|
|
22
|
+
"delayOff": "Автоматическое выключение (мс)",
|
|
23
|
+
"delayOffDesc": "Автоматически выключается через указанное количество миллисекунд. Установите 0 для отключения.",
|
|
24
|
+
"addSwitch": "Добавить переключатель",
|
|
25
|
+
"removeSwitch": "Удалить",
|
|
26
|
+
"save": "Сохранить",
|
|
27
|
+
"on": "Вкл",
|
|
28
|
+
"off": "Выкл"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": "Çoklu Anahtar Platformu",
|
|
3
|
+
"platformName": "Platform Adı",
|
|
4
|
+
"platformNameDesc": "Bu platform örneğinin HomeKit'teki adı.",
|
|
5
|
+
"switchBehavior": "Anahtar Davranış Modu",
|
|
6
|
+
"switchBehaviorDesc": "Anahtarların birbirleriyle nasıl etkileşime gireceğini kontrol eder.",
|
|
7
|
+
"behaviorIndependent": "Bağımsız",
|
|
8
|
+
"behaviorMaster": "Ana Kontrol",
|
|
9
|
+
"behaviorSingle": "Tekli",
|
|
10
|
+
"switches": "Anahtarlar",
|
|
11
|
+
"switchesDesc": "Oluşturulacak sanal anahtarların listesi.",
|
|
12
|
+
"switchName": "Anahtar Adı",
|
|
13
|
+
"switchNameDesc": "Anahtarın HomeKit'teki görünen adı.",
|
|
14
|
+
"switchType": "Anahtar Tipi",
|
|
15
|
+
"switchTypeDesc": "Bu anahtar için HomeKit aksesuar tipi.",
|
|
16
|
+
"typeSwitch": "Anahtar",
|
|
17
|
+
"typeOutlet": "Priz",
|
|
18
|
+
"typeLightbulb": "Ampul",
|
|
19
|
+
"typeFan": "Vantilatör",
|
|
20
|
+
"defaultState": "Varsayılan Durum",
|
|
21
|
+
"defaultStateDesc": "Homebridge başladığında başlangıç güç durumu.",
|
|
22
|
+
"delayOff": "Otomatik Kapanma (ms)",
|
|
23
|
+
"delayOffDesc": "Belirtilen milisaniye sonra otomatik kapanır. Devre dışı bırakmak için 0 yazın.",
|
|
24
|
+
"addSwitch": "Anahtar Ekle",
|
|
25
|
+
"removeSwitch": "Kaldır",
|
|
26
|
+
"save": "Kaydet",
|
|
27
|
+
"on": "Açık",
|
|
28
|
+
"off": "Kapalı"
|
|
29
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"header": "多开关平台",
|
|
3
|
+
"platformName": "平台名称",
|
|
4
|
+
"platformNameDesc": "此平台实例在 HomeKit 中的名称。",
|
|
5
|
+
"switchBehavior": "开关行为模式",
|
|
6
|
+
"switchBehaviorDesc": "控制开关之间的交互方式。",
|
|
7
|
+
"behaviorIndependent": "独立",
|
|
8
|
+
"behaviorMaster": "主控",
|
|
9
|
+
"behaviorSingle": "单选",
|
|
10
|
+
"switches": "开关",
|
|
11
|
+
"switchesDesc": "要创建的虚拟开关列表。",
|
|
12
|
+
"switchName": "开关名称",
|
|
13
|
+
"switchNameDesc": "开关在 HomeKit 中的显示名称。",
|
|
14
|
+
"switchType": "开关类型",
|
|
15
|
+
"switchTypeDesc": "此开关的 HomeKit 配件类型。",
|
|
16
|
+
"typeSwitch": "开关",
|
|
17
|
+
"typeOutlet": "插座",
|
|
18
|
+
"typeLightbulb": "灯泡",
|
|
19
|
+
"typeFan": "风扇",
|
|
20
|
+
"defaultState": "默认状态",
|
|
21
|
+
"defaultStateDesc": "Homebridge 启动时的初始电源状态。",
|
|
22
|
+
"delayOff": "自动关闭(毫秒)",
|
|
23
|
+
"delayOffDesc": "在指定的毫秒数后自动关闭。设置为 0 以禁用。",
|
|
24
|
+
"addSwitch": "添加开关",
|
|
25
|
+
"removeSwitch": "删除",
|
|
26
|
+
"save": "保存",
|
|
27
|
+
"on": "开",
|
|
28
|
+
"off": "关"
|
|
29
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
<style>
|
|
2
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
3
|
+
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; color: #333; }
|
|
4
|
+
.form-group { margin-bottom: 16px; }
|
|
5
|
+
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 14px; }
|
|
6
|
+
.desc { color: #666; font-size: 12px; margin-bottom: 6px; }
|
|
7
|
+
input[type="text"], input[type="number"], select {
|
|
8
|
+
width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px;
|
|
9
|
+
font-size: 14px; background: #fff; transition: border-color 0.2s;
|
|
10
|
+
}
|
|
11
|
+
input:focus, select:focus { border-color: #007bff; outline: none; }
|
|
12
|
+
.switch-card {
|
|
13
|
+
border: 1px solid #ddd; border-radius: 8px; padding: 16px; margin-bottom: 12px;
|
|
14
|
+
background: #fafafa; position: relative;
|
|
15
|
+
}
|
|
16
|
+
.switch-card .switch-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
|
|
17
|
+
.switch-card .switch-header strong { font-size: 14px; }
|
|
18
|
+
.btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
|
|
19
|
+
.btn-danger { background: #dc3545; color: #fff; }
|
|
20
|
+
.btn-danger:hover { background: #c82333; }
|
|
21
|
+
.btn-primary { background: #007bff; color: #fff; }
|
|
22
|
+
.btn-primary:hover { background: #0069d9; }
|
|
23
|
+
.btn-success { background: #28a745; color: #fff; }
|
|
24
|
+
.btn-success:hover { background: #218838; }
|
|
25
|
+
.actions { margin-top: 16px; display: flex; gap: 10px; }
|
|
26
|
+
h4 { margin-bottom: 8px; }
|
|
27
|
+
.toggle-wrap { display: flex; align-items: center; gap: 8px; }
|
|
28
|
+
.toggle-wrap input[type="checkbox"] { width: 18px; height: 18px; }
|
|
29
|
+
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid #eee; }
|
|
30
|
+
.inline-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
|
|
31
|
+
</style>
|
|
32
|
+
|
|
33
|
+
<div id="app"></div>
|
|
34
|
+
|
|
35
|
+
<script>
|
|
36
|
+
(async () => {
|
|
37
|
+
let t = {};
|
|
38
|
+
|
|
39
|
+
async function loadTranslations() {
|
|
40
|
+
let lang = 'en';
|
|
41
|
+
try { lang = await homebridge.i18nCurrentLang(); } catch {}
|
|
42
|
+
const tryLangs = [lang, lang.split('-')[0], 'en'];
|
|
43
|
+
for (const l of tryLangs) {
|
|
44
|
+
try {
|
|
45
|
+
const res = await fetch(`./i18n/${l}.json`);
|
|
46
|
+
if (res.ok) { t = await res.json(); return; }
|
|
47
|
+
} catch {}
|
|
48
|
+
}
|
|
49
|
+
try {
|
|
50
|
+
const res = await fetch('./i18n/en.json');
|
|
51
|
+
t = await res.json();
|
|
52
|
+
} catch {}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
await loadTranslations();
|
|
56
|
+
|
|
57
|
+
let config = {};
|
|
58
|
+
try {
|
|
59
|
+
const configs = await homebridge.getPluginConfig();
|
|
60
|
+
config = configs[0] || {};
|
|
61
|
+
} catch {}
|
|
62
|
+
|
|
63
|
+
const app = document.getElementById('app');
|
|
64
|
+
|
|
65
|
+
function render() {
|
|
66
|
+
const switches = config.switches || [];
|
|
67
|
+
app.innerHTML = `
|
|
68
|
+
<div class="form-group">
|
|
69
|
+
<label>${t.platformName || 'Platform Name'}</label>
|
|
70
|
+
<div class="desc">${t.platformNameDesc || ''}</div>
|
|
71
|
+
<input type="text" id="cfg-name" value="${esc(config.name || 'Multiple Switch Platform')}">
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<div class="form-group">
|
|
75
|
+
<label>${t.switchBehavior || 'Switch Behavior Mode'}</label>
|
|
76
|
+
<div class="desc">${t.switchBehaviorDesc || ''}</div>
|
|
77
|
+
<select id="cfg-behavior">
|
|
78
|
+
<option value="independent" ${config.switchBehavior === 'independent' || !config.switchBehavior ? 'selected' : ''}>${t.behaviorIndependent || 'Independent'}</option>
|
|
79
|
+
<option value="master" ${config.switchBehavior === 'master' ? 'selected' : ''}>${t.behaviorMaster || 'Master'}</option>
|
|
80
|
+
<option value="single" ${config.switchBehavior === 'single' ? 'selected' : ''}>${t.behaviorSingle || 'Single'}</option>
|
|
81
|
+
</select>
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
<div class="section-title">${t.switches || 'Switches'}</div>
|
|
85
|
+
<div class="desc" style="margin-bottom:12px">${t.switchesDesc || ''}</div>
|
|
86
|
+
|
|
87
|
+
<div id="switches-list">
|
|
88
|
+
${switches.map((sw, i) => renderSwitch(sw, i)).join('')}
|
|
89
|
+
</div>
|
|
90
|
+
|
|
91
|
+
<div class="actions">
|
|
92
|
+
<button class="btn btn-primary" id="btn-add">+ ${t.addSwitch || 'Add Switch'}</button>
|
|
93
|
+
</div>
|
|
94
|
+
`;
|
|
95
|
+
|
|
96
|
+
document.getElementById('cfg-name').addEventListener('change', (e) => {
|
|
97
|
+
config.name = e.target.value;
|
|
98
|
+
save();
|
|
99
|
+
});
|
|
100
|
+
document.getElementById('cfg-behavior').addEventListener('change', (e) => {
|
|
101
|
+
config.switchBehavior = e.target.value;
|
|
102
|
+
save();
|
|
103
|
+
});
|
|
104
|
+
document.getElementById('btn-add').addEventListener('click', () => {
|
|
105
|
+
if (!config.switches) config.switches = [];
|
|
106
|
+
config.switches.push({ name: '', type: 'outlet', defaultState: false, delayOff: 0 });
|
|
107
|
+
render();
|
|
108
|
+
save();
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
document.querySelectorAll('.btn-remove').forEach(btn => {
|
|
112
|
+
btn.addEventListener('click', () => {
|
|
113
|
+
const idx = parseInt(btn.dataset.idx);
|
|
114
|
+
config.switches.splice(idx, 1);
|
|
115
|
+
render();
|
|
116
|
+
save();
|
|
117
|
+
});
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
document.querySelectorAll('.sw-field').forEach(input => {
|
|
121
|
+
input.addEventListener('change', () => {
|
|
122
|
+
const idx = parseInt(input.dataset.idx);
|
|
123
|
+
const field = input.dataset.field;
|
|
124
|
+
if (field === 'defaultState') {
|
|
125
|
+
config.switches[idx][field] = input.checked;
|
|
126
|
+
} else if (field === 'delayOff') {
|
|
127
|
+
config.switches[idx][field] = parseInt(input.value) || 0;
|
|
128
|
+
} else {
|
|
129
|
+
config.switches[idx][field] = input.value;
|
|
130
|
+
}
|
|
131
|
+
save();
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function renderSwitch(sw, i) {
|
|
137
|
+
return `
|
|
138
|
+
<div class="switch-card">
|
|
139
|
+
<div class="switch-header">
|
|
140
|
+
<strong>#${i + 1}</strong>
|
|
141
|
+
<button class="btn btn-danger btn-remove" data-idx="${i}">${t.removeSwitch || 'Remove'}</button>
|
|
142
|
+
</div>
|
|
143
|
+
<div class="inline-row">
|
|
144
|
+
<div class="form-group">
|
|
145
|
+
<label>${t.switchName || 'Switch Name'}</label>
|
|
146
|
+
<input type="text" class="sw-field" data-idx="${i}" data-field="name" value="${esc(sw.name || '')}">
|
|
147
|
+
</div>
|
|
148
|
+
<div class="form-group">
|
|
149
|
+
<label>${t.switchType || 'Switch Type'}</label>
|
|
150
|
+
<select class="sw-field" data-idx="${i}" data-field="type">
|
|
151
|
+
<option value="switch" ${sw.type === 'switch' ? 'selected' : ''}>${t.typeSwitch || 'Switch'}</option>
|
|
152
|
+
<option value="outlet" ${sw.type === 'outlet' || !sw.type ? 'selected' : ''}>${t.typeOutlet || 'Outlet'}</option>
|
|
153
|
+
<option value="lightbulb" ${sw.type === 'lightbulb' ? 'selected' : ''}>${t.typeLightbulb || 'Lightbulb'}</option>
|
|
154
|
+
<option value="fan" ${sw.type === 'fan' ? 'selected' : ''}>${t.typeFan || 'Fan'}</option>
|
|
155
|
+
</select>
|
|
156
|
+
</div>
|
|
157
|
+
</div>
|
|
158
|
+
<div class="inline-row">
|
|
159
|
+
<div class="form-group">
|
|
160
|
+
<label>${t.delayOff || 'Auto Turn Off (ms)'}</label>
|
|
161
|
+
<input type="number" class="sw-field" data-idx="${i}" data-field="delayOff" min="0" value="${sw.delayOff || 0}">
|
|
162
|
+
</div>
|
|
163
|
+
<div class="form-group">
|
|
164
|
+
<label>${t.defaultState || 'Default State'}</label>
|
|
165
|
+
<div class="toggle-wrap" style="margin-top:6px">
|
|
166
|
+
<input type="checkbox" class="sw-field" data-idx="${i}" data-field="defaultState" ${sw.defaultState ? 'checked' : ''}>
|
|
167
|
+
<span>${sw.defaultState ? (t.on || 'On') : (t.off || 'Off')}</span>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
`;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function esc(str) {
|
|
176
|
+
const d = document.createElement('div');
|
|
177
|
+
d.textContent = str;
|
|
178
|
+
return d.innerHTML.replace(/"/g, '"');
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
async function save() {
|
|
182
|
+
await homebridge.updatePluginConfig([config]);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
render();
|
|
186
|
+
})();
|
|
187
|
+
</script>
|
package/package.json
CHANGED