feat: standardize device type for Sound Level Meters (SLM)

- Updated all instances of device_type from "sound_level_meter" to "slm" across the codebase.
- Enhanced documentation to reflect the new device type standardization.
- Added migration script to convert legacy device types in the database.
- Updated relevant API endpoints, models, and frontend templates to use the new device type.
- Ensured backward compatibility by deprecating the old device type without data loss.
This commit is contained in:
serversdwn
2026-01-16 18:31:27 +00:00
parent 6c7ce5aad0
commit 1ef0557ccb
22 changed files with 488 additions and 72 deletions

View File

@@ -131,7 +131,7 @@ async def create_scheduled_action(
raise HTTPException(status_code=404, detail="Location not found")
# Determine device type from location
device_type = "sound_level_meter" if location.location_type == "sound" else "seismograph"
device_type = "slm" if location.location_type == "sound" else "seismograph"
# Get unit_id (optional - can be determined from assignment at execution time)
unit_id = form_data.get("unit_id")
@@ -188,7 +188,7 @@ async def schedule_recording_session(
if not location:
raise HTTPException(status_code=404, detail="Location not found")
device_type = "sound_level_meter" if location.location_type == "sound" else "seismograph"
device_type = "slm" if location.location_type == "sound" else "seismograph"
unit_id = form_data.get("unit_id")
start_time = datetime.fromisoformat(form_data.get("start_time"))