feat(peripheral-demo): add Sensor Data card to operator view#725
feat(peripheral-demo): add Sensor Data card to operator view#725nicomiguelino wants to merge 6 commits intofeat/peripheral-integration-pocfrom
Conversation
- Add humidity and airPressure fields to AppState (nullable, default null) - Add setHumidity and setAirPressure mutations to state - Parse humidity and air_pressure readings from peripheral WS messages - Add Sensor Data glass card to operator screen with temperature, humidity, air pressure - Show "No Data" fallback until first WS message arrives - Handle nullable temperature in public view temperature pill Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PR Reviewer Guide 🔍(Review updated until commit c84b3ad)Here are some key observations to aid the review process:
|
|
Persistent review updated to latest commit c84b3ad |
PR Code Suggestions ✨Latest suggestions up to c84b3ad
Previous suggestionsSuggestions up to commit c84b3ad
|
There was a problem hiding this comment.
Pull request overview
Adds additional environmental sensor readings (humidity + air pressure) to the peripheral integration demo’s state and UI, so the operator view can display a consolidated “Sensor Data” card with sensible null/empty fallbacks before the first WebSocket message arrives.
Changes:
- Extended
AppStatewith nullablehumidityandairPressure(and madetemperaturenullable) plus new mutations to update these fields. - Parsed
humidityandair_pressurefrom peripheral WS state messages and stored them in app state. - Added an Operator “Sensor Data” glass card and updated operator/public UI rendering to handle null sensor values (“No Data” /
--).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
edge-apps/peripheral-integration-demo/src/features/peripherals.ts |
Parses additional sensor readings from WS state and updates app state. |
edge-apps/peripheral-integration-demo/src/features/operator-dashboard.ts |
Renders sensor values (or “No Data”) into the operator dashboard UI. |
edge-apps/peripheral-integration-demo/src/core/state.ts |
Adds nullable sensor fields and mutations for humidity/air pressure. |
edge-apps/peripheral-integration-demo/src/core/screen.ts |
Updates public temperature pill to handle nullable temperature. |
edge-apps/peripheral-integration-demo/index.html |
Adds the new “Sensor Data” operator card with temperature/humidity/air pressure fields. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
edge-apps/peripheral-integration-demo/src/features/peripherals.ts
Outdated
Show resolved
Hide resolved
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Update setTemperature, setHumidity, setAirPressure to accept number | null - Keeps state API consistent with the nullable AppState field types Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
649b011 to
6285ffa
Compare
…ify call - Replace individual setTemperature/setHumidity/setAirPressure setters with a single setSensorReadings batch mutation - Update peripherals.ts to use setSensorReadings, reducing notify() calls from 3 to 1 per WebSocket message Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@salmanfarisvp, please review this PR when you get the chance. This merges into #719's branch. |
- Install highlight.js for JSON syntax highlighting - Store last peripheral WebSocket message in module-level state - Add Raw Peripheral State glass card to maintenance screen - Render highlighted JSON via highlight.js (Monokai theme) on maintenance view load Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…l-sensor-data-on-operator-view
Overview
Screenshot(s)