fix: handle missing playback/hls gracefully in WebsocketEvent#1145
Open
KTibow wants to merge 1 commit into
Open
fix: handle missing playback/hls gracefully in WebsocketEvent#1145KTibow wants to merge 1 commit into
KTibow wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #1145 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 16 16
Lines 1020 1021 +1
=========================================
+ Hits 1020 1021 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
9cf4037 to
383509d
Compare
SimpliSafe has started sending playback/flv instead of playback/hls for some camera models. The hardcoded playback/hls key access causes a KeyError that crashes the entire websocket loop. - Use .get() for playback/hls and playback/flv to handle missing keys - Add flv_url field alongside hls_url for FLV-only video links - Keep image_url and clip_url as direct [] access (these are actively used and a missing key there indicates a real API change) - Add test fixture and test case for FLV-only video events Fixes bachya#1144
383509d to
09fa528
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SimpliSafe has started sending
playback/flvinstead ofplayback/hlsfor some camera models (confirmed onSS001). The hardcodedplayback/hlskey access inWebsocketEvent.__post_init__causes aKeyErrorthat crashes the entire websocket loop, meaning no further events are received.This fix:
.get()forplayback/hlsandplayback/flvto handle missing keys gracefullyflv_urlfield alongsidehls_urlfor FLV-only video linksimage_urlandclip_urlas direct[]access (these are actively used and a missing key there indicates a real API change)Testing
Verified with 23 passing tests including the new
test_create_motion_event_flvtest case.Fixes #1144
Disclosure
Drafted by Kimi K2.6 with human oversight