Skip to content

Commit

Permalink
Merge branch 'beta-1.0.0' into bdsoha-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Apr 20, 2023
2 parents 8a1eb06 + e5f54f7 commit 9b3b0a1
Show file tree
Hide file tree
Showing 16 changed files with 2,250 additions and 3,698 deletions.
4,884 changes: 2,154 additions & 2,730 deletions package-lock.json

Large diffs are not rendered by default.

28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"url": "https://github.com/homebridge/HAP-NodeJS/issues"
},
"engines": {
"node": ">=10.17.0"
"node": ">=14"
},
"files": [
"README.md",
Expand All @@ -57,31 +57,31 @@
"bonjour-hap": "~3.6.4",
"debug": "^4.3.4",
"fast-srp-hap": "~2.0.4",
"futoin-hkdf": "~1.4.3",
"futoin-hkdf": "~1.5.1",
"node-persist": "^0.0.11",
"source-map-support": "^0.5.21",
"tslib": "^2.4.0",
"tslib": "^2.4.1",
"tweetnacl": "^1.0.3"
},
"devDependencies": {
"@types/debug": "^4.1.7",
"@types/escape-html": "^1.0.2",
"@types/jest": "^27.4.1",
"@types/node": "^10.17.60",
"@typescript-eslint/eslint-plugin": "^5.21.0",
"@typescript-eslint/parser": "^5.21.0",
"commander": "^6.2.1",
"@types/jest": "^29.2.3",
"@types/node": "^14.18.33",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"commander": "^9.4.1",
"escape-html": "^1.0.3",
"http-parser-js": "^0.5.8",
"eslint": "^8.14.0",
"jest": "^27.5.1",
"eslint": "^8.28.0",
"jest": "^29.3.1",
"rimraf": "^3.0.2",
"semver": "^7.3.7",
"semver": "^7.3.8",
"simple-plist": "1.1.1",
"ts-jest": "^27.1.4",
"ts-node": "^10.7.0",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typedoc": "^0.23.21",
"typescript": "~4.9.3",
"axios": "^0.27.2"
"axios": "^1.2.0"
}
}
4 changes: 2 additions & 2 deletions src/accessories/Camera_accessory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@ class MP4StreamingServer {
console.log(this.ffmpegPath + " " + this.args.join(" "));

this.childProcess = spawn(this.ffmpegPath, this.args, { env: process.env, stdio: this.debugMode? "pipe": "ignore" });
if (!this.childProcess) {
console.error("ChildProcess is undefined directly after the init!");
if (!this.childProcess ||!this.childProcess.stdout || !this.childProcess.stderr) {
throw new Error("ChildProcess or its streams is undefined directly after the init!");
}
if(this.debugMode) {
this.childProcess.stdout.on("data", data => console.log(data.toString()));
Expand Down
22 changes: 11 additions & 11 deletions src/accessories/gstreamer-audioProducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,28 +128,28 @@ export class GStreamerAudioProducer implements SiriAudioStreamProducer {
debug("Failed to kill gstreamer process: " + error.message);
}
});
this.process.stdout.on("data", (data: Buffer) => {
this.process.stdout!.on("data", (data: Buffer) => {
if (!this.running) { // received data after it was closed
return;
}

/*
This listener seems to get called with only one opus frame most of the time.
Though it happens regularly that another or many more frames get appended.
This causes some problems as opus frames don't contain their data length in the "header".
Opus relies on the container format to specify the length of the frame.
Although sometimes multiple opus frames are squashed together the decoder seems to be able
to handle that as it just creates a not very noticeable distortion.
If we would want to make this perfect we would need to write a nodejs c++ submodule or something
to interface directly with gstreamer api.
*/
This listener seems to get called with only one opus frame most of the time.
Though it happens regularly that another or many more frames get appended.
This causes some problems as opus frames don't contain their data length in the "header".
Opus relies on the container format to specify the length of the frame.
Although sometimes multiple opus frames are squashed together the decoder seems to be able
to handle that as it just creates a not very noticeable distortion.
If we wanted to make this perfect we would need to write a nodejs c++ submodule or something
to interface directly with gstreamer api.
*/

this.frameHandler({
data: data,
rms: 0.25, // only way currently to extract rms from gstreamer is by interfacing with the api directly (nodejs c++ submodule could be a solution)
});
});
this.process.stderr.on("data", data => {
this.process.stderr!.on("data", data => {
debug("GStreamer process reports the following error: " + String(data));
});
this.process.on("exit", (code, signal) => {
Expand Down
105 changes: 10 additions & 95 deletions src/lib/Characteristic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import type {
CarbonMonoxideDetected,
CarbonMonoxideLevel,
CarbonMonoxidePeakLevel,
Category,
CCAEnergyDetectThreshold,
CCASignalDetectThreshold,
CharacteristicValueActiveTransitionCount,
Expand All @@ -39,8 +38,6 @@ import type {
ClosedCaptions,
ColorTemperature,
ConfigurationState,
ConfigureBridgedAccessory,
ConfigureBridgedAccessoryStatus,
ConfiguredName,
ContactSensorState,
CoolingThresholdTemperature,
Expand All @@ -59,17 +56,13 @@ import type {
CurrentSlatState,
CurrentTemperature,
CurrentTiltAngle,
CurrentTime,
CurrentTransport,
CurrentVerticalTiltAngle,
CurrentVisibilityState,
DataStreamHAPTransport,
DataStreamHAPTransportInterrupt,
DayoftheWeek,
DiagonalFieldOfView,
DigitalZoom,
DiscoverBridgedAccessories,
DiscoveredBridgedAccessories,
DisplayOrder,
EventRetransmissionMaximum,
EventSnapshotsActive,
Expand All @@ -95,7 +88,6 @@ import type {
InUse,
IsConfigured,
LeakDetected,
LinkQuality,
ListPairings,
LockControlPoint,
LockCurrentState,
Expand All @@ -109,6 +101,8 @@ import type {
ManagedNetworkEnable,
ManuallyDisabled,
Manufacturer,
MatterFirmwareRevisionNumber,
MatterFirmwareUpdateStatus,
MaximumTransmitPower,
MetricsBufferFullState,
Model,
Expand Down Expand Up @@ -145,15 +139,11 @@ import type {
ProgrammableSwitchEvent,
ProgrammableSwitchOutputState,
ProgramMode,
Reachable,
ReceivedSignalStrengthIndication,
ReceiverSensitivity,
RecordingAudioActive,
RelativeHumidityDehumidifierThreshold,
RelativeHumidityHumidifierThreshold,
RelayControlPoint,
RelayEnabled,
RelayState,
RemainingDuration,
RemoteKey,
ResetFilterIndication,
Expand Down Expand Up @@ -239,13 +229,8 @@ import type {
ThreadNodeCapabilities,
ThreadOpenThreadVersion,
ThreadStatus,
TimeUpdate,
Token,
TransmitPower,
TunnelConnectionTimeout,
TunneledAccessoryAdvertising,
TunneledAccessoryConnected,
TunneledAccessoryStateNumber,
ValveType,
Version,
VideoAnalysisActive,
Expand Down Expand Up @@ -817,11 +802,6 @@ export class Characteristic extends EventEmitter {
* @group Characteristic Definitions
*/
public static CarbonMonoxidePeakLevel: typeof CarbonMonoxidePeakLevel;
/**
* @group Characteristic Definitions
* @deprecated Removed and not used anymore
*/
public static Category: typeof Category;
/**
* @group Characteristic Definitions
*/
Expand Down Expand Up @@ -854,16 +834,6 @@ export class Characteristic extends EventEmitter {
* @group Characteristic Definitions
*/
public static ConfigurationState: typeof ConfigurationState;
/**
* @group Characteristic Definitions
* @deprecated Removed and not used anymore
*/
public static ConfigureBridgedAccessory: typeof ConfigureBridgedAccessory;
/**
* @group Characteristic Definitions
* @deprecated Removed and not used anymore
*/
public static ConfigureBridgedAccessoryStatus: typeof ConfigureBridgedAccessoryStatus;
/**
* @group Characteristic Definitions
*/
Expand Down Expand Up @@ -936,11 +906,6 @@ export class Characteristic extends EventEmitter {
* @group Characteristic Definitions
*/
public static CurrentTiltAngle: typeof CurrentTiltAngle;
/**
* @group Characteristic Definitions
* @deprecated Removed and not used anymore
*/
public static CurrentTime: typeof CurrentTime;
/**
* @group Characteristic Definitions
*/
Expand All @@ -961,11 +926,6 @@ export class Characteristic extends EventEmitter {
* @group Characteristic Definitions
*/
public static DataStreamHAPTransportInterrupt: typeof DataStreamHAPTransportInterrupt;
/**
* @group Characteristic Definitions
* @deprecated Removed and not used anymore
*/
public static DayoftheWeek: typeof DayoftheWeek;
/**
* @group Characteristic Definitions
*/
Expand All @@ -974,16 +934,6 @@ export class Characteristic extends EventEmitter {
* @group Characteristic Definitions
*/
public static DigitalZoom: typeof DigitalZoom;
/**
* @group Characteristic Definitions
* @deprecated Removed and not used anymore
*/
public static DiscoverBridgedAccessories: typeof DiscoverBridgedAccessories;
/**
* @group Characteristic Definitions
* @deprecated Removed and not used anymore
*/
public static DiscoveredBridgedAccessories: typeof DiscoveredBridgedAccessories;
/**
* @group Characteristic Definitions
*/
Expand Down Expand Up @@ -1084,11 +1034,6 @@ export class Characteristic extends EventEmitter {
* @group Characteristic Definitions
*/
public static LeakDetected: typeof LeakDetected;
/**
* @group Characteristic Definitions
* @deprecated Removed and not used anymore
*/
public static LinkQuality: typeof LinkQuality;
/**
* @group Characteristic Definitions
*/
Expand Down Expand Up @@ -1141,6 +1086,14 @@ export class Characteristic extends EventEmitter {
* @group Characteristic Definitions
*/
public static Manufacturer: typeof Manufacturer;
/**
* @group Characteristic Definitions
*/
public static MatterFirmwareRevisionNumber: typeof MatterFirmwareRevisionNumber;
/**
* @group Characteristic Definitions
*/
public static MatterFirmwareUpdateStatus: typeof MatterFirmwareUpdateStatus;
/**
* @group Characteristic Definitions
*/
Expand Down Expand Up @@ -1285,11 +1238,6 @@ export class Characteristic extends EventEmitter {
* @group Characteristic Definitions
*/
public static ProgramMode: typeof ProgramMode;
/**
* @group Characteristic Definitions
* @deprecated Removed and not used anymore
*/
public static Reachable: typeof Reachable;
/**
* @group Characteristic Definitions
*/
Expand All @@ -1310,18 +1258,6 @@ export class Characteristic extends EventEmitter {
* @group Characteristic Definitions
*/
public static RelativeHumidityHumidifierThreshold: typeof RelativeHumidityHumidifierThreshold;
/**
* @group Characteristic Definitions
*/
public static RelayControlPoint: typeof RelayControlPoint;
/**
* @group Characteristic Definitions
*/
public static RelayEnabled: typeof RelayEnabled;
/**
* @group Characteristic Definitions
*/
public static RelayState: typeof RelayState;
/**
* @group Characteristic Definitions
*/
Expand Down Expand Up @@ -1664,11 +1600,6 @@ export class Characteristic extends EventEmitter {
* @group Characteristic Definitions
*/
public static ThreadStatus: typeof ThreadStatus;
/**
* @group Characteristic Definitions
* @deprecated Removed and not used anymore
*/
public static TimeUpdate: typeof TimeUpdate;
/**
* @group Characteristic Definitions
*/
Expand All @@ -1677,22 +1608,6 @@ export class Characteristic extends EventEmitter {
* @group Characteristic Definitions
*/
public static TransmitPower: typeof TransmitPower;
/**
* @group Characteristic Definitions
*/
public static TunnelConnectionTimeout: typeof TunnelConnectionTimeout;
/**
* @group Characteristic Definitions
*/
public static TunneledAccessoryAdvertising: typeof TunneledAccessoryAdvertising;
/**
* @group Characteristic Definitions
*/
public static TunneledAccessoryConnected: typeof TunneledAccessoryConnected;
/**
* @group Characteristic Definitions
*/
public static TunneledAccessoryStateNumber: typeof TunneledAccessoryStateNumber;
/**
* @group Characteristic Definitions
*/
Expand Down
Loading

0 comments on commit 9b3b0a1

Please sign in to comment.