LunaEvent: rework sleep event

Make the UI more flexible and
slightly easier to understand.
This commit is contained in:
2026-02-02 21:03:51 +01:00
parent d9d1b8cb83
commit bba8ccd1c9
6 changed files with 138 additions and 59 deletions

View File

@@ -115,6 +115,18 @@ class LunaEvent: Comparable<LunaEvent> {
return getDialogMessage(context, type)
}
fun getStartTime(): Long {
return time
}
fun getEndTime(): Long {
return if (type == Type.SLEEP) {
time + quantity
} else {
time
}
}
fun toJson(): JSONObject {
return jo
}