update for volume

This commit is contained in:
Koushik Dutta
2021-09-09 17:49:25 -07:00
parent 5a248572fd
commit 9442c92cf4
12 changed files with 41 additions and 32 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/core",
"version": "0.0.72",
"version": "0.0.76",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/core",
"version": "0.0.72",
"version": "0.0.76",
"license": "Apache-2.0",
"dependencies": {
"@scrypted/sdk": "file:../../sdk",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/core",
"version": "0.0.72",
"version": "0.0.76",
"description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.",
"author": "Scrypted",
"license": "Apache-2.0",

View File

@@ -140,6 +140,7 @@ for (const type of [ScryptedDeviceType.Light, ScryptedDeviceType.Outlet, Scrypte
}
cardComponentTypes.push(new CardComponentType(ScryptedDeviceType.Sensor, 0, true, 6, DashboardMap, { cardName: "Map" }, ScryptedInterface.PositionSensor));
cardComponentTypes.push(new CardComponentType(ScryptedDeviceType.Camera, 0, false, 4, DashboardCamera, undefined, ScryptedInterface.Camera, ScryptedInterface.VideoCamera));
cardComponentTypes.push(new CardComponentType(ScryptedDeviceType.Doorbell, 0, false, 4, DashboardCamera, undefined, ScryptedInterface.Camera, ScryptedInterface.VideoCamera));
cardComponentTypes.push(new CardComponentType(ScryptedDeviceType.Lock, 15, false, 1, DashboardLock, undefined, ScryptedInterface.Lock));
cardComponentTypes.push(new CardComponentType(ScryptedDeviceType.Thermostat, 20, false, 1, DashboardThermostat, undefined, ScryptedInterface.TemperatureSetting));
cardComponentTypes.push(new CardComponentType(ScryptedDeviceType.Vacuum, 10, false, 1, DashboardStartStop, undefined, ScryptedInterface.StartStop));
@@ -180,7 +181,7 @@ const cardComponentSettings: Map<string, Setting[]> = new Map();
{
title: "Camera Device",
key: "deviceId",
type: `device:${JSON.stringify(ScryptedDeviceType.Camera)} === type && (interfaces.includes(${JSON.stringify(ScryptedInterface.Camera)}) || interfaces.includes(${JSON.stringify(ScryptedInterface.VideoCamera)}))`,
type: `device:(${JSON.stringify(ScryptedDeviceType.Camera)} === type || ${JSON.stringify(ScryptedDeviceType.Doorbell)} === type) && (interfaces.includes(${JSON.stringify(ScryptedInterface.Camera)}) || interfaces.includes(${JSON.stringify(ScryptedInterface.VideoCamera)}))`,
value: null,
}
]);

View File

@@ -21,8 +21,8 @@
persistent-hint
>
<template v-slot:append-outer>
<v-btn v-if="dirty" color="green" dark tile @click="save" class="shift-up">
<v-icon>check</v-icon>
<v-btn v-if="dirty" color="green" outlined @click="save" class="shift-up">
<v-icon>fa-save</v-icon>
</v-btn>
</template>
</v-select>
@@ -55,8 +55,8 @@
:description="lazyValue.description"
>
<template v-slot:append-outer>
<v-btn v-if="dirty" color="green" dark tile @click="save" class="shift-up">
<v-icon>check</v-icon>
<v-btn v-if="dirty" color="green" outlined @click="save" class="shift-up">
<v-icon>fa-save</v-icon>
</v-btn>
</template>
</DevicePicker>
@@ -72,8 +72,8 @@
:type="lazyValue.type && lazyValue.type.toLowerCase() === 'password' ? 'password' : undefined"
>
<template v-slot:append-outer>
<v-btn v-if="dirty" color="green" dark tile @click="save" class="shift-up">
<v-icon>check</v-icon>
<v-btn v-if="dirty" color="green" outlined @click="save" class="shift-up">
<v-icon>fa-save</v-icon>
</v-btn>
</template>
</v-text-field>

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/homekit",
"version": "0.0.34",
"version": "0.0.37",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/homekit",
"version": "0.0.34",
"version": "0.0.37",
"dependencies": {
"axios": "^0.21.1",
"hap-nodejs": "file:../HAP-NodeJS",

View File

@@ -42,5 +42,5 @@
"@types/node": "^14.17.9",
"@types/url-parse": "^1.4.3"
},
"version": "0.0.34"
"version": "0.0.37"
}

View File

@@ -60,9 +60,19 @@ class HomeKit extends ScryptedDeviceBase implements MixinProvider, Settings {
}
getUsername() {
return this.storage.getItem("mac") || (Object.entries(os.networkInterfaces()).filter(([iface, entry]) => iface.startsWith('en') || iface.startsWith('wlan')) as any)
let username = this.storage.getItem("mac") || (Object.entries(os.networkInterfaces()).filter(([iface, entry]) => iface.startsWith('en') || iface.startsWith('wlan')) as any)
.flat().map(([iface, entry]) => entry).find(i => i && (i.family === 'IPv4' || i.family === 'IPv6'))?.mac;
}
if (!username) {
const buffers = [];
for (let i = 0; i < 6; i++) {
buffers.push(randomBytes(1).toString('hex'));
}
username = buffers.join(':');
this.storage.setItem('mac', username);
}
return username;
}
async getSettings(): Promise<Setting[]> {
return [
@@ -116,7 +126,7 @@ class HomeKit extends ScryptedDeviceBase implements MixinProvider, Settings {
}
catch (e) {
console.error('error while checking device if syncable', e);
throw e;
continue;
}
const accessory = supportedType.getAccessory(device);
@@ -141,15 +151,7 @@ class HomeKit extends ScryptedDeviceBase implements MixinProvider, Settings {
this.storage.setItem('defaultIncluded', JSON.stringify(defaultIncluded));
let username = this.getUsername();
if (!username) {
const buffers = [];
for (let i = 0; i < 6; i++) {
buffers.push(randomBytes(1).toString('hex'));
}
username = buffers.join(':');
this.storage.setItem('username', username);
}
const username = this.getUsername();
this.bridge.publish({
username: this.getUsername(),

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/rtsp",
"version": "0.0.19",
"version": "0.0.20",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/rtsp",
"version": "0.0.19",
"version": "0.0.20",
"license": "Apache",
"dependencies": {
"axios": "^0.18.1",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/rtsp",
"version": "0.0.19",
"version": "0.0.20",
"description": "RTSP Cameras and Streams Plugin for Scrypted",
"author": "Scrypted",
"license": "Apache",

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/zwave",
"version": "0.0.27",
"version": "0.0.28",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/zwave",
"version": "0.0.27",
"version": "0.0.28",
"license": "Apache",
"dependencies": {
"@scrypted/sdk": "file:../../sdk",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/zwave",
"version": "0.0.27",
"version": "0.0.28",
"description": "Z-Wave USB Controller for Scrypted",
"author": "Scrypted",
"license": "Apache",

View File

@@ -7,6 +7,7 @@ import debounce from "lodash/debounce";
import { Driver, Endpoint, ZWaveController, ZWaveNode, CommandClass } from "zwave-js";
import { ValueID, CommandClasses } from "@zwave-js/core"
import { randomBytes } from "crypto";
import path from "path/posix";
const { log, deviceManager } = sdk;
@@ -60,8 +61,13 @@ export class ZwaveControllerProvider extends ScryptedDeviceBase implements Devic
this.log.a('No Network Key was present, so a random one was generated. You can change the Network Key in Settings.')
}
const cacheDir = path.join(process.env['SCRYPTED_PLUGIN_VOLUME'], 'cache');
this.console.log(process.cwd());
const driver = new Driver(this.storage.getItem('serialPort'), {
networkKey
networkKey,
storage: {
cacheDir,
}
});
this.driver = driver;
console.log(driver.cacheDir);