diff --git a/.changeset/large-boxes-smile.md b/.changeset/large-boxes-smile.md new file mode 100644 index 00000000..b43752b6 --- /dev/null +++ b/.changeset/large-boxes-smile.md @@ -0,0 +1,6 @@ +--- +'homebridge-ring': patch +'ring-client-api': patch +--- + +Ignore unused camera messages diff --git a/packages/ring-client-api/streaming/streaming-messages.ts b/packages/ring-client-api/streaming/streaming-messages.ts index f231dbdc..df15d238 100644 --- a/packages/ring-client-api/streaming/streaming-messages.ts +++ b/packages/ring-client-api/streaming/streaming-messages.ts @@ -42,6 +42,19 @@ interface NotificationMessage { } & SessionBody } +interface CameraStartedMessage { + method: 'camera_started' + body: SessionBody +} + +interface StreamInfoMessage { + method: 'stream_info' + body: SessionBody & { + transcoding: boolean + transcoding_reason: 'codec_mismatch' | string + } +} + // eslint-disable-next-line no-shadow enum CloseReasonCode { NormalClose = 0, @@ -68,3 +81,5 @@ export type IncomingMessage = | PongMessage | CloseMessage | NotificationMessage + | CameraStartedMessage + | StreamInfoMessage diff --git a/packages/ring-client-api/streaming/webrtc-connection.ts b/packages/ring-client-api/streaming/webrtc-connection.ts index 5a238024..084cc07b 100644 --- a/packages/ring-client-api/streaming/webrtc-connection.ts +++ b/packages/ring-client-api/streaming/webrtc-connection.ts @@ -219,6 +219,10 @@ export class WebrtcConnection extends Subscribed { logError(message.body) this.callEnded() return + case 'camera_started': + case 'stream_info': + // ignore these messages as we don't use them + return } logError('UNKNOWN MESSAGE')