Based on PCAP analysis of official Mi Home app traffic:
- Official app sends PING every ~1 second
- Previous 5-second interval was too slow, causing connection resets
Simply reduce keepalive timeout from 5s to 1s.
Based on PCAP analysis of official Mi Home app traffic, the keepalive
mechanism was incorrect:
Before (broken):
- Sent PING every 5s only when receiving data
- Responded to PING with PONG
After (fixed):
- Send PING every 1 second independently via dedicated goroutine
- Don't respond to PING with PONG (official app doesn't either)
- Both sides send PING bidirectionally as heartbeats
The official app sends 199 PING messages and 0 PONG messages in a
typical session. This fix matches that behavior.
Fixes connection resets after prolonged streaming sessions with
Xiaomi cameras using the CS2 P2P protocol.
Enhances the YAML linter to validate scalar values against enum and pattern constraints defined in the schema. Adds utility functions for value comparison, schema constraint collection, and applies these checks during linting to provide more precise error messages for invalid values.
Adds logic to trigger the suggestion widget when completing a property if it expects a block or has value suggestions, improving the user experience in the config editor.
Simplifies the logic for handling block scalar content by restructuring the conditional checks for blockScalarParentIndent. This improves readability and ensures correct processing of indented lines.
Replaces optional chaining with explicit null checks and more robust object property access throughout the file. Refactors destructuring and object spreading to use Object.assign for better compatibility. These changes improve code reliability and compatibility with older browsers or environments lacking support for newer JavaScript features.