Skip to content

Commit

Permalink
Ignore unused camera messages
Browse files Browse the repository at this point in the history
Closes #1509
  • Loading branch information
dgreif committed Nov 2, 2024
1 parent 77cdf78 commit 7f9a19f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .changeset/large-boxes-smile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'homebridge-ring': patch
'ring-client-api': patch
---

Ignore unused camera messages
15 changes: 15 additions & 0 deletions packages/ring-client-api/streaming/streaming-messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -68,3 +81,5 @@ export type IncomingMessage =
| PongMessage
| CloseMessage
| NotificationMessage
| CameraStartedMessage
| StreamInfoMessage
4 changes: 4 additions & 0 deletions packages/ring-client-api/streaming/webrtc-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 7f9a19f

Please sign in to comment.