Coder Social home page Coder Social logo

vmiklos / plees-tracker Goto Github PK

View Code? Open in Web Editor NEW
158.0 8.0 38.0 4.34 MB

Plees Tracker is a simple sleep tracker for your Android phone.

Home Page: https://vmiklos.hu/plees-tracker/

License: MIT License

Shell 1.01% Kotlin 96.73% Python 1.79% Makefile 0.05% JavaScript 0.43%
android sleep tracker kotlin

plees-tracker's Introduction

plees-tracker

tests

Plees Tracker is a simple sleep tracker for your Android phone.

Description

Check out the user guide for a list of features and installation and usage information.

License

Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.

plees-tracker's People

Contributors

easyvector avatar ely3m avatar eyap53 avatar fabianski7 avatar foss- avatar k3dar avatar lastaapps avatar machinething avatar martiandolphin avatar sebastien46 avatar sebidersushi avatar sguinetti avatar spikeysanju avatar toveri avatar vmiklos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

plees-tracker's Issues

Dashboard meanings are confusing

  • "Nights" means how many times you started and stopped sleeping.
  • "Average" is apparently the average time between starting and stopping. That's what it was in the past, at least (I think).
  • What does "Daily" mean? My guess it that it's the median time of what "Average" is based on. Also, my "Daily" is something like "95:55:11".

[Feature Request] Set to app to create automatic exports for backups

Hello,

I use this app to track my sleep and love it so far. It has everything I need regarding features to track my sleep. The only thing I would like to ask if it would be possible to set an automatic export of data once every day or week?

The reason for this is that I could then tell my NextCloud app to always upload all data from the backup folder when I'm on WIFI. This way if I lose my phone (and haven't manually exported the data in a while) I would still have an automatic backup.

UI/UX: Adding stars can lead to deleting the entry by swiping

I was using Sleep as Android and there adding rating to record can be swiped. (Swiping on the stars works like slider.) It is very natural an intuitive

However, in plees-tracker I always swipe whole record and accidentally delete it.

Luckily the "undo" saves me.


Can this "slide to rate" function can be added? Is it easy?

This is small UX improvement so if its hard to implement I guess it's not worth big effort, but if it's easy it would save me some miss-clicks and nerves. :)

Feature Request: Automation app (Tasker, Macrodroid etc.) integration

Hi!

Just wondering if it's possible to add a feature allowing third party apps to trigger tracker functions. Use cases could be, toggle the tracker by scanning a NFC tag without tapping the phone or even with screen off; auto trigger start/stop at user configured time; etc.

I notice two ways of implementing this, hope it's helpful.

  1. broadcast intents

    • Track Work Time, codes

      [...] TWT can be triggered from other apps and just do the book-keeping of your work time. In this case, you have to create broadcast intents with the action org.zephyrsoft.trackworktime.ClockIn or org.zephyrsoft.trackworktime.ClockOut. [...]

    • Pano Scrobbler for LastFM codes

  2. Tasker plugin

Thanks for the app!

Start Time not saved after change without comment

Version 7.3

Reproducer steps

  1. Press Start, press stop (to enter time where start had not been pressed earlier )
  2. Change start time to earlier time.
  3. Click OK

Actual result
Time isn't saved.

Occasionally message shows briefly that says something like 'Start time is not before stop time. Not saved' It is quick and not all the time, but change is not saved.

IF a comment is entered , time change is saved.

Expected behavior

Changing start time should be saved without comment.

Add a start time offset

No one falls asleep right as they press 'Start'. An option to add a start time offset would be neat. Could just be pre made values like 5, 10, 15 minutes or an exact value input (in minutes).

Wanted to try and implement this myself, but I unforunately have 0 experience with android applications.

"Daily" stat seems to omit 0-sleep days when averaging

I am curious about "how much sleep time do i have per day on average?".
I maintain extremely irregular sleeping habits that can include days with absolutely no sleep at all. In this case, an average stat that takes these days into account is required.

However, this let's me acknowledge 3 valid stats:

  • Average sleep duration (current average stat)
  • Average sleep on days with sleep (current daily stat?)
    This is relevant to answer "How long are my sleep sessions on average?" with multiple sleeps a day. It is not entirely accurate but grouping sleeps per day looks like a simple definition for "sleep session" that still makes sense.
  • Average sleep duration per day
    The use case i described in this issue

Quick Settings tile to start/stop sleep

Similar to #92, it would be cool if Plees could provide a Quick Settings tile to start and stop sleep. The benefit here is that it would be possible to start/stop sleep without having to open the app, e.g. from the lock screen.

Add "wake time" graph

Just like the "start time" graph, but for end/wake times. Would you mind if I made a pull request for this? Just wanted to ask ahead of time.

UI: When Awake Duration is ON -> It's hard to see where one entry ends and another begins

Reproducer steps

  1. Log few entries
  2. Set "Show awake duration" to ON

Actual result
image

Expected behavior
Some UI element (spacing/separator) would be great to visually separate the logs. Maybe even to get creative and add some UI element containing awake-for.

[  Start     ..... ]
[  End       ..... ]
[  Duration  ..... ]
                                          <---- spacing
--- Awake time inside separator ----
                                          <---- spacing
[  Start     ..... ]
[  End       ..... ]
[  Duration  ..... ]

Cannot import csv after export

I wanted to edit the start/stop timestamps of the last sleep, so I exported the csv file and manually changed it with an editor.
Now I'm trying to import the file again, but the import file selector does not let me choose any file from internal memory - all the files are greyed out and cannot be selected.

Improve deletion undo usability

The undo UI has issues:

  1. It covers the start/stop button. If I delete what I wanted to delete, I can't restart immediately.
  2. It disappears too soon. If I delete what I don't want to delete, I have no time to recognize that.
  3. You may not recognize that you've deleted the wrong thing if you are actually sleepy. It could show some details like the duration and the ending time.

Overlapped and blocked texts on main page

Describe the bug

Dear developer!
In the process of using, I found a bug in layout / display. As shown in the figure below, on the main page, some texts can not be seen fully and some texts overlap with each other. This may be an adaptation problem. I suspect it is because display and font size are set to large (mainly due to display size).
Because of some problems with my eyesight, I often use the largest font and display.
103165857-dbaf8580-4857-11eb-9e22-120ae1901389

App version is 7.1.5, my mobile phone is Google Pixel 2, and the screen resolution setting is 1920* 1080. And my font size and display size are the largest ! ! ! Also, my Android system version is 10.0.
The above is a description of the problem. The overall experience of the software is good. You can see that the design is very attentive. Thank you very much for the efforts of the developers all the time. I hope to receive a reply. Thank you so much!!

Expected behavior

I hope that the texts on the main page could be seen fully and without overlapping.

Steps to reproduce the behavior:

1.use the largest font and display in the display setting
2.open this app for the first time, and then click "start" and "stop" for a couple of times.
3.this error could be seen

Screenshot

copy

Environment

  1. Version of plees-tracker : 7.1.5,
  2. Device : Google Pixel 2,
  3. OS version : Android 10.0

A new icon for 'Awake for'

This is a really minor enhancement, but different icon for the 'Awake for' data point would be nice. Currently it's the exact same as the 'Started on icon'.

Can't create Sleep the morning after

Reproducer steps

  1. Press start button
  2. Press stop button a few seconds later
  3. Click on the sleep in the list to open the edit menu
  4. Edit the start time to 2:00 AM the same day
  5. Edit the end time to 11:30 AM the same day

Actual result
Popup: "Not updating the sleep, stop is not after start". When you leave the menu, the sleep is recorded lasting a few seconds, none of the times are saved.

Expected behavior
For the times to be saved properly, resulting in the correct duration. This has worked before, but has stopped after the recent update.

Negative sleep durations are possible

It is possible to change a past sleep to start after it began

Reproducer steps

  1. Track some sleep
  2. Tap on past sleep to enter detailed view
  3. Tap on "Started on"
  4. Change the starting date to the future

Actual result
Sleep with negative duration is accepted.
image_1.jpg

Expected behavior
Invalid sleep durations are not permitted

Importing entries from the calendar creates duplicates

Reproducer steps

  1. Log some sleeps
  2. Export them to calendar
  3. Import them back
  4. There are duplicitie

Actual result
There are duplicitie

Expected behavior
No duplicities

The issue is related to #150 which was solving the export duplication problem.

24h time picker

For users of 24h time format, a 24h time picker would be preferred.
I'm not familiar with specific implementations, but for example the LineageOS Clock application or Etar Calendar on F-Droid feature 24h time pickers.

They present a regular 12 hour clock face with a second, smaller inner circle of continued numbers that count beyond 12 hours.

Consider lowering required API level

I've been stuck on an old version of this app because new versions now require API 24. As you know, that means ~20% of Android devices (which is tens of millions of devices) cannot use the current version of this app.

Personally, I repurpose an old Android device as my "sleep device".

What would be lost by changing the minimum required API to a level that would allow this helpful app to work with at least 95% of Android devices that are in use? If 95% isn't a reasonable goal, what about ~90%?

Dark mode

I think a dark mode would be a valuable addition to the app, especially since it's going to be mainly used at night. I've never made an android app before but I changed some variables around after installing android studio which resulted with this which looks like this:

Preferably the app will be able to switch between dark and light modes as android changes between dark and light mode.

I will try to figure out how to do it myself and submit a pull request but, as I said, I've never done android development before so no guarantees.

Export to calendar crashes

Reproducer steps

  1. Click: Settings -> Export to Calendar
  2. Select calendar
  3. Click confirm button (Select)

Actual result
App crashes

Expected behavior
App wont crash, and starts to synchronize sleeps into selected calendar


The feature was implemented in this issue: #41

Delay when adding new sleep

As I mentioned in #88 (apologies for all the issues), I recently imported a few years worth of sleep data from Sleep as Android into Plees, and I noticed that now when I try to add a new sleep there is a significant delay, around 10 seconds, between tapping stop and seeing the new sleep appear on the dashboard.

Video: https://user-images.githubusercontent.com/2847492/104951028-996cf600-5976-11eb-81be-b36cdbbe78aa.mp4

I assume this is a scaling problem with the number of sleeps, so perhaps #88 might help with this, though it isn't a complete solution.

Automatic backup does not happen after editing a sleep

Reproducer steps

  1. Create a sleep with start/stop
  2. Backup file gets automatically updated
  3. Edit a sleep

Actual result
Backup file stays the same

Expected behavior
Backup file should get updated after editing as well. Without this, the backup stays out of date whenever a sleep is edited.

Cause
backupSleeps() only gets called inside startStop() inside the main activity:

fun startStop(@Suppress("UNUSED_PARAMETER") v: View) {
if (DataModel.start != null && DataModel.stop == null) {
DataModel.stop = Calendar.getInstance().time
viewModel.stopSleep()
backupSleeps()

but not inside updateSleep():

private fun updateSleep(activity: SleepActivity, sleep: Sleep) {
viewModelScope.launch {
DataModel.updateSleep(sleep)
showSleep(activity, sleep.sid)
}
}

Ideas for more statistics

Let's post ideas for more stats, one idea per comment (so that people can just use reactions on them).

Chronological order of list not enforced

Modifying the times of a sleep entry can produce an entry listing with non chronological order.

I'd propose sorting the list by start time to make sure everything stays sorted.

Request: start/stop widget for home screen

Hi. I just downloaded this app and it seems great - does what I need and nothing I don't need. The one addition I would love is a simple widget on my home screen that I could tap to start and stop a sleep session.

Automatic backup shows as enabled even when folder is not selected

Reproducer steps

  1. Attempt to enable Automatic backup, opening Files app
  2. Refuse to select a folder by repeated pressing back button or closing the app
  3. Automatic backup shows as enabled in settings even though no folder was selected

Actual result
Unclear but I assume no backup occurs.

Expected behavior
Automatic backup goes back to disabled if no folder is selected.

Related, it would be nice if the folder selected were shown if Automatic backup is enabled.

Scroll whole view

With the resigned UI (looks quite good) more than half of the vertical space is taken up by fixed content, rest of the space barely fits two records.

Presently only the record list is scrollable, it would be nice if whole screen scrolled. It would make going through records easier.

Allow the user to manually edit an entry

Sometimes I forget to press start before falling asleep, and manually editing unix timestamps in a csv file is kind of a pain. I suggest creating a date and time editor for the start/stop times of an entry, so that a user could tap/long press an entry and manually adjust it, without having to export a file, do math with unix timestamps, and import the file again.

Feature Request: Sleep rating

I tried to do this on my own and submit a pull request, but alas, I'm new to Kotlin (I normally code in Python or Java, thought I could hack it.) So I was unable to achieve my objective: Simple 1-5 rating for sleep.

The (non-privacy respecting/add riddled) sleep apps I've used in the past usually all have a simple 1-5 (though usually in half or quarter steps) star rating system. I find this momentary reflection on my sleep to be valuable in tracking the over all quality of my sleep. I can't imagine it would be to hard to implement, but the compiler yelled at me when I tried so I'm submitting a feature request instead.

Feature: Calendar Integration as visualisation and form of backup

Thank you for awesome FOSS app! ๐Ÿ˜

I like to propose a feature to allow integration with standart Android calendar.

This has multiple benefits:

  • Allow visualisation of sleep interval withou need to actually code it.
  • Adds backup out of the box (calendar can be synced by different app like EteSync or in privicy worst scenario by Google).

Btw, do you have BTC donation address? I may want to add it into README.md ๐Ÿ˜ผ

Start and stop button on dark theme

The button for starting and stopping a sleep cycle is too hard to notice in the dark theme of the app. I've included a screenshot to demonstrate it. Perhaps it would be useful to add some sort of outline of the button to better illustrate it and make it for noticeable in the next update.

plees-tracker-dark

FR : ability to rate & add info/comments to sleep items to better understand your sleep

Hi !

I'm trying to monitor my sleep, and your app being nice and FOSS, I've used it for some nights. I'm happy with it ! :)

My problem is that, after a few nights, I cannot remember if, when waking up in the morning, I felt fantastic, good, tired or wrecked !

There are a number of info I'd be willing to add/store with each sleep item:

  • a rating of the night (i.e. wake up feeling with regards to the night) : with stars from 0 to 5
  • room temperature : a number
  • food quantity : rating from 0 to 5
  • moon phase : well, a moon phase

What would be lovely would be to be able to add more info to sleep items, to try detect patterns like :

  • sleep quality vs sleep length
  • sleep quality vs bed time
  • sleep quality vs food quantity
  • sleep quality vs room temperature
  • sleep quality vs moon phases
  • sleep quality vs small awoken periods at night

As a MVP, simply adding & storing a sleep rating (from 0 to 5 stars) would be fine, so one is able to look it up afterwards. And make one's own stats/analysis.

As a V2, showing for each rating : the average bedtime, avg sleep length, avg room temp, avg moon phases, avg food quantity (1to5) would be fantastic.

What do you think about this ?

Thanks
GLLM

Data Export Help

Hi, i don't know if this is a issue or i am doing something wrong, but i want to export the data and do analytics.
I can see there is an export option, which exports to a csv, but i cannot understand the numbers in the start and stop columns. I thought maybe they are UNIX dates, so i tried converting them but it turns out, they give me some really wild results. take for example

sid,start,stop
3,1588031041720,1588070163374
5,1588142846876,1588165544783

if we are to convert them i get something like

09/12/52292 @ 9:48pm (UTC)

Which is way beyond the mark. What should i do?

FR : ask for user validation before deleting a night/sleep

Hi,

Thanks for this nice FOSS sleep app ! Happy to have find it on F-Droid !!

Suggestion :
In the main screen, when swiping right or left on a night/sleep, the swiped item is deleted.
A user validation would be fine, or at least showing the fact that it will be deleted by showing a trashbin on the left when swiping right (resp. on the right when swiping left).

Thanks
GLLM

Sound recording (feature request)

one crucial feature in sleep tracking app for me is recording the peaks in volume that you set & then in the morning you can listen to those peaks (if and when you were snoring, if a dog barking or traffic is waking you up, or any other noises etc.)
Please implement voice recorder, where you set the peaks where it starts recording, and then it can be reviewed on a sound line showing volume peaks and time.

Customize Dashboard duration

I recently tried importing my years of sleeps from Sleep As Android into Plees[1], and noticed that the Dashboard summary is always set to stats of all previous sleeps. While this made sense initially, I'd personally rather see only stats from just my recent sleeps, eg the past week. Would it be possible to make the Dashboard summary duration customizable, for example to the options provided in the Statistics page (Last 7 days, This year, All time)?

1: If anybody else needs it, here's the quick Python script I wrote to convert Sleep as Android CSV to Plees CSV: https://gist.github.com/usashiki/d6f918b1d3c8035f3da8a9f51962c417 Edit: see contrib/sleep-as-android.py

Duplicates created when exporting/importing into/from calendar

Reproducer steps

  1. Log few sleeps
  2. Export to calendar
  3. Export again

Actual result

  • The calendar has duplicates
  • Same issue for import (duplicates are created in the Plees Tracker)

Expected behavior
Entry should have unique ID and skip duplicates when exporting/importing

[Bug] Scrolling down in Statistics menu ends up showing an empty screen

Hi !
Using 7.1.4 on Android 9 (Samsung Galaxy S8+):

when I go to the Statistics menu, and I scroll down, then sleep statistics move up until the very last ... yet it continues to scroll and the screen is now blank of any statistics.
After this, I cannot scroll up to see again the statistics. I must exit this menu and go in again.

I do expect to the scrolling to stop when the last item is shown at the bottom of the screen.
A visual cue showing you cannot scroll more would be great.

Thanks
GLLM

[Feature Request] allow multi-line notes, extend #239

Thanks for making this app.

I suggest to extend the feature requst #239: In the Sleep Details view for one night I suggest to expand the Notes section from one line to some kind of text box so that I can read longer texts I entered.

I don't think that linebreaks in such notes are needed. I can imagine, that handling linebreaks might compliate the csv export and so on.

There's a lot of blank space at the bottom of the screen, so that e.g. a five-line box should fit well.

I think this still fits to a simple sleep tracker and is not feature creep. For me it's very useful to take longer notes, e.g. if, when, and why I woke up during the night, how tired I was after getting up (which is not always related to how well or long I slept), and some things that might influence the sleep quality from the evening before like exercise, watching TV, etc.

There are a lot of other apps that allow to exactly quantitavely track such other stuff. But that's too much for me and it's complicated to use two apps. I assume for a lot of people it's sufficient to have some qualitative notes to find out some big factors that influence their sleep. Or maybe other people want to capture some notes about dreams in the app they already use and that respects their privacy.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.