firmware: add I2S MEMS microphone driver; fix missing essence migration
Mic: confirmed via its pinout (L/R, WS, SCK, SD, VCC, GND) that the third target module is a standard I2S digital MEMS mic (INMP441-family). Added mems_mic.c/h using ESP-IDF's current driver/i2s_std.h API — reports RMS audio level in dBFS as sensor_type "evp" rather than attempting on-device voice-band FFT (the browser EVP mode's approach); the backend's existing statistical anomaly detector handles spike detection from the raw level, same as it already does for temperature/pressure/presence. Also fixes a real gap Workstream B's report flagged: User.essence (a live model column used throughout merged code — /auth/me, inventory purchases, summon trickle) had no migration line in main.py's lifespan, which would have broken on the actual production Postgres database.
This commit is contained in:
@@ -54,6 +54,14 @@ async def lifespan(app: FastAPI):
|
||||
await conn.execute(text(
|
||||
"ALTER TABLE entities ADD COLUMN IF NOT EXISTS traits JSONB NOT NULL DEFAULT '{}'::jsonb"
|
||||
))
|
||||
# Workstream C (character-depth-ghost-log spec) — missing from C's
|
||||
# own commit, added by the integrator after Workstream B's report
|
||||
# flagged that User.essence had a live model column and application
|
||||
# code (auth/me, inventory purchases, summon trickle) but no
|
||||
# migration, which would have broken on the real production DB.
|
||||
await conn.execute(text(
|
||||
"ALTER TABLE users ADD COLUMN IF NOT EXISTS essence INTEGER NOT NULL DEFAULT 0"
|
||||
))
|
||||
# Workstream B (character-depth-ghost-log spec).
|
||||
await conn.execute(text(
|
||||
"ALTER TABLE users ADD COLUMN IF NOT EXISTS favor DOUBLE PRECISION NOT NULL DEFAULT 0.0"
|
||||
|
||||
Reference in New Issue
Block a user