How colterize/lega-watch works
Lega Watch is an Apple Watch air-quality monitor. The user opens a list of locations, selects one, and sees its current sensor status and a summary; the row and detail view independently request the selected sensor’s latest Firebase gas reading. FirebaseViewModel converts readings into a smoke value and health status. The repository also includes a report/chart model and watch notification and complication entry points. Source excerpts establish the main view and data calls; unsampled notification, complication, and chart behavior is not inferred beyond the shown code and index references.
Main entry points: FirebaseViewModel.swift Firebase view model · Lega_WatchApp.swift Watch app · LocationView.swift Location list · LocationDetailView.swift Location detail
Components 16
Watch interface
- Watch app
Lega Watch WatchKit Extension/Lega_WatchApp.swift - Location list
Lega Watch WatchKit Extension/Views/LocationView.swift - Location row
Lega Watch WatchKit Extension/Views/LocationRow.swift - Location detail
Lega Watch WatchKit Extension/Views/LocationDetailView.swift - Live status
Lega Watch WatchKit Extension/Views/LocationPulsation.swift - Location summary
Lega Watch WatchKit Extension/Views/LocationSummary.swift - Report chart
Lega Watch WatchKit Extension/Views/ChartView.swift
Sensor readings
- Firebase view model
Lega Watch WatchKit Extension/FirebaseViewModel.swift
Location and reports
- Location definitions
Lega Watch WatchKit Extension/Model/ModelData.swift - Hourly reports
Lega Watch WatchKit Extension/Model/Report.swift
Watch features
- Notification host
Lega Watch WatchKit Extension/NotificationController.swift - Notification view
Lega Watch WatchKit Extension/NotificationView.swift - Complication source
Lega Watch WatchKit Extension/ComplicationController.swift
Other components
- Watch user
- Firebase Realtime Database
- WatchKit runtime
Connections 15
- Watch user → Watch app: opens
Lega Watch WatchKit Extension/Lega_WatchApp.swift - Watch app → Location list: shows
Lega Watch WatchKit Extension/Lega_WatchApp.swift - Watch app → Notification host: registers
Lega Watch WatchKit Extension/Lega_WatchApp.swift - Location list → Location row: renders
Lega Watch WatchKit Extension/Views/LocationView.swift - Location list → Location detail: navigates
Lega Watch WatchKit Extension/Views/LocationView.swift - Location row → Firebase view model: requests reading
Lega Watch WatchKit Extension/Views/LocationRow.swift - Location detail → Live status: shows
Lega Watch WatchKit Extension/Views/LocationDetailView.swift - Location detail → Location summary: shows
Lega Watch WatchKit Extension/Views/LocationDetailView.swift - Live status → Firebase view model: requests reading
Lega Watch WatchKit Extension/Views/LocationPulsation.swift - Firebase view model → Firebase Realtime Database: reads latest value
Lega Watch WatchKit Extension/FirebaseViewModel.swift - Firebase view model → Hourly reports: records reading
Lega Watch WatchKit Extension/FirebaseViewModel.swift - Report chart → Hourly reports: plots reports
Lega Watch WatchKit Extension/Views/ChartView.swift - Notification host → Notification view: hosts
Lega Watch WatchKit Extension/NotificationController.swift - WatchKit runtime → Notification host: presents
- WatchKit runtime → Complication source: requests timeline