diff --git a/insight/src/main/java/info/nightscout/androidaps/insight/database/InsightDatabaseDao.kt b/insight/src/main/java/info/nightscout/androidaps/insight/database/InsightDatabaseDao.kt index e602b3bf77..c941eb76e2 100644 --- a/insight/src/main/java/info/nightscout/androidaps/insight/database/InsightDatabaseDao.kt +++ b/insight/src/main/java/info/nightscout/androidaps/insight/database/InsightDatabaseDao.kt @@ -21,8 +21,8 @@ abstract class InsightDatabaseDao { @Insert(onConflict = OnConflictStrategy.REPLACE) abstract fun createOrUpdate(insightHistoryOffset: InsightHistoryOffset) - @Query("SELECT * from $DATABASE_INSIGHT_PUMP_IDS WHERE pumpSerial = :pumpSerial AND (eventType = :PumpStopped OR eventType = :PumpPaused) AND timestamp < :timestamp ORDER BY timestamp DESC") - abstract fun getPumpStoppedEvent(pumpSerial: String, timestamp: Long, PumpStopped: EventType, PumpPaused: EventType): InsightPumpID? + @Query("SELECT * from $DATABASE_INSIGHT_PUMP_IDS WHERE pumpSerial = :pumpSerial AND (eventType = :pumpStopped OR eventType = :pumpPaused) AND timestamp < :timestamp ORDER BY timestamp DESC") + abstract fun getPumpStoppedEvent(pumpSerial: String, timestamp: Long, pumpStopped: EventType, pumpPaused: EventType): InsightPumpID? fun getPumpStoppedEvent(pumpSerial: String, timestamp: Long): InsightPumpID? = getPumpStoppedEvent(pumpSerial, timestamp, EventType.PumpStopped, EventType.PumpPaused)