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:
@@ -111,26 +111,6 @@ async def startup_event():
|
||||
await start_scheduler()
|
||||
logger.info("Scheduler service started")
|
||||
|
||||
# Sync all SLMs to SLMM on startup
|
||||
logger.info("Syncing SLM devices to SLMM...")
|
||||
try:
|
||||
from backend.services.slmm_sync import sync_all_slms_to_slmm, cleanup_orphaned_slmm_devices
|
||||
from backend.database import SessionLocal
|
||||
|
||||
db = SessionLocal()
|
||||
try:
|
||||
# Sync all SLMs from roster to SLMM
|
||||
sync_results = await sync_all_slms_to_slmm(db)
|
||||
logger.info(f"SLM sync complete: {sync_results}")
|
||||
|
||||
# Clean up orphaned devices in SLMM
|
||||
cleanup_results = await cleanup_orphaned_slmm_devices(db)
|
||||
logger.info(f"SLMM cleanup complete: {cleanup_results}")
|
||||
finally:
|
||||
db.close()
|
||||
except Exception as e:
|
||||
logger.error(f"Error syncing SLMs to SLMM on startup: {e}")
|
||||
|
||||
@app.on_event("shutdown")
|
||||
def shutdown_event():
|
||||
"""Clean up services on app shutdown"""
|
||||
|
||||
Reference in New Issue
Block a user