mirror of
https://github.com/koush/scrypted.git
synced 2026-09-17 17:20:39 +01:00
homekit: populate override address options
This commit is contained in:
4
plugins/homekit/package-lock.json
generated
4
plugins/homekit/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/homekit",
|
||||
"version": "0.0.95",
|
||||
"version": "0.0.96",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/homekit",
|
||||
"version": "0.0.95",
|
||||
"version": "0.0.96",
|
||||
"dependencies": {
|
||||
"hap-nodejs": "file:../HAP-NodeJS",
|
||||
"lodash": "^4.17.21",
|
||||
|
||||
@@ -40,5 +40,5 @@
|
||||
"@types/qrcode": "^1.4.1",
|
||||
"@types/url-parse": "^1.4.3"
|
||||
},
|
||||
"version": "0.0.95"
|
||||
"version": "0.0.96"
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import qrcode from 'qrcode';
|
||||
import packageJson from "../package.json";
|
||||
import { randomPinCode } from './pincode';
|
||||
import { EventedHTTPServer } from '../HAP-NodeJS/src/lib/util/eventedhttp';
|
||||
import { AddressInfo } from 'net';
|
||||
|
||||
const { systemManager, deviceManager } = sdk;
|
||||
|
||||
@@ -83,13 +84,15 @@ class HomeKit extends ScryptedDeviceBase implements MixinProvider, Settings, Hom
|
||||
|
||||
getHomeKitHubs(): string[] {
|
||||
try {
|
||||
return JSON.parse(this.storage.getItem('homekitHubs'));
|
||||
return JSON.parse(this.storage.getItem('homekitHubs'));
|
||||
}
|
||||
catch (e) {
|
||||
}
|
||||
}
|
||||
|
||||
async getSettings(): Promise<Setting[]> {
|
||||
const addresses = (Object.entries(os.networkInterfaces()).filter(([iface]) => iface.startsWith('en') || iface.startsWith('wlan')) as any)
|
||||
.flat().map(([, entry]) => entry.address).filter((address: string) => address);
|
||||
return [
|
||||
{
|
||||
title: "Manual Pairing Code",
|
||||
@@ -112,7 +115,9 @@ class HomeKit extends ScryptedDeviceBase implements MixinProvider, Settings, Hom
|
||||
title: 'Bridge Address',
|
||||
value: localStorage.getItem('addressOverride'),
|
||||
key: 'addressOverride',
|
||||
description: 'Optional: The network address used by the Scrypted bridge. Set this to the wired address to prevent usage of wireless address.'
|
||||
description: 'Optional: The network address used by the Scrypted bridge. Set this to the wired address to prevent usage of wireless address.',
|
||||
choices: addresses,
|
||||
combobox: true,
|
||||
},
|
||||
{
|
||||
title: 'HomeKit Hubs',
|
||||
|
||||
Reference in New Issue
Block a user