Skip to content

feat: add wifi, room climate, and water level to device status (#157, #192)#389

Open
ng wants to merge 3 commits intodevfrom
fix/157-192-device-status-enrichment
Open

feat: add wifi, room climate, and water level to device status (#157, #192)#389
ng wants to merge 3 commits intodevfrom
fix/157-192-device-status-enrichment

Conversation

@ng
Copy link
Copy Markdown
Contributor

@ng ng commented Apr 6, 2026

Summary

  • device.getStatus now returns wifiStrength, wifiSSID (from /proc/net/wireless + iwgetid)
  • Returns roomClimate: { temperatureC, humidity, timestamp } from latest bed temp sensor
  • Returns waterLevelRaw: { raw, calibratedEmpty, calibratedFull, timestamp } from latest water level reading
  • Migration 0007 adds raw, calibrated_empty, calibrated_full columns to water_level_readings
  • All enrichment is best-effort (null values on failure, graceful defaults on non-Linux)

Review fixes applied

Test plan

  • Typecheck passes
  • 620 tests pass
  • Migration runs successfully
  • Manual: call GET /device/status on Pod and verify wifi/roomClimate/waterLevelRaw fields
  • Manual: verify graceful fallback on macOS dev (null/default values)

Closes #157, closes #192

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 6, 2026

Warning

Rate limit exceeded

@ng has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 24 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 8 minutes and 24 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 581652d5-20e5-41a1-8bd7-d74c9ab34304

📥 Commits

Reviewing files that changed from the base of the PR and between 6deee72 and e7aa060.

📒 Files selected for processing (6)
  • src/db/biometrics-migrations/0007_peaceful_blue_shield.sql
  • src/db/biometrics-migrations/meta/0007_snapshot.json
  • src/db/biometrics-migrations/meta/_journal.json
  • src/db/biometrics-schema.ts
  • src/hardware/wifi.ts
  • src/server/routers/device.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/157-192-device-status-enrichment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

ng added 3 commits April 10, 2026 15:27
device.getStatus now returns:
- wifi: { signalStrength, ssid } from /proc/net/wireless (defaults on non-Linux)
- roomClimate: { temperatureF, humidity, timestamp } from latest bed temp sensor
- waterLevel: { level, timestamp } from latest water level reading

All enrichment is best-effort — null values on failure.

Closes #157, closes #192
- Replace execSync('cat ...') with readFileSync for /proc/net/wireless
- Use spawnSync for iwgetid (no shell layer)
- Flatten wifi fields to wifiStrength/wifiSSID per issue #157 spec
- Return temperatureC (not temperatureF) per issue #192 spec
- Serialize timestamps as unix ms (number) per spec
- Narrow waterLevel.level type to 'low' | 'ok' | null
- Move getWifiInfo() inside enrichment try/catch
…elRaw per #192 spec

Migration adds raw, calibrated_empty, calibrated_full columns.
getStatus now returns waterLevelRaw: { raw, calibratedEmpty, calibratedFull, timestamp }
matching the issue #192 specification.
@ng ng force-pushed the fix/157-192-device-status-enrichment branch from 5d18760 to e7aa060 Compare April 10, 2026 22:33
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.

Add room climate and raw water level to device status Add wifi signal strength to device.getStatus

1 participant