Skip to content

Conversation

@dallonby
Copy link

Summary

Problem

Some RAW files contain records where data is an empty byte string (b''). Calling cbor2.loads(b'') raises CBORDecodeEOF which inherits from EOFError. The existing except EOFError: break handler caught this exception and exited the loop entirely.

This caused the stream processor to only capture ~4 piezo records per sleep session instead of continuous data, resulting in only 2-3 vitals records per night instead of hundreds.

Test plan

  • Deployed fix to device and restarted free-sleep-stream service
  • Verified stream logs show "Inserting vitals record..." every ~60 seconds
  • Confirmed database now has 9 vitals records in 10 minutes (vs 3 records in previous 24 hours)

🤖 Generated with Claude Code

The same fix from PR throwaway31265#38 (19ac510) needs to be applied to stream.py.
Some RAW files contain records where 'data' is an empty byte string.
Calling cbor2.loads(b'') raises CBORDecodeEOF (inherits from EOFError),
which was caught by the EOFError handler and broke out of the read loop.

This caused the stream processor to only capture ~4 piezo records per
sleep session instead of continuous data, resulting in only 2-3 vitals
records per night instead of hundreds.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Dec 26, 2025

@dallonby is attempting to deploy a commit to the david's projects Team on Vercel.

A member of the Team first needs to authorize it.

dallonby and others added 2 commits December 28, 2025 13:21
Implements automatic temperature adjustments based on biometric signals:
- Shivering detection (warms up when user is cold)
- Restlessness detection (cools down when user is too warm)
- Sleep onset detection (cools down to help falling asleep)

Includes safety limits, cooldown periods, and event logging for visualization.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant