Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to manually assign nap / sleep? #323

Closed
sfgabe opened this issue Oct 25, 2021 · 6 comments
Closed

Possible to manually assign nap / sleep? #323

sfgabe opened this issue Oct 25, 2021 · 6 comments

Comments

@sfgabe
Copy link

sfgabe commented Oct 25, 2021

Working with a newborn here and the idea of a "nap" depends more on where the sleeping happens - ie: in the swing is a nap / back sleeping in bed is sleep.

Is it possible to create a checkbox for "nap" instead of relying on the config? Also, bed times are going to change as sleep gets more regular - can this be something that is configurable in the UI instead of editing the config whenever that happens?

@cdubz
Copy link
Member

cdubz commented Oct 25, 2021

Hm that seems reasonable and I feel like its something that should have been mentioned before by others. I wonder why it hasn't...

Not totally sure on the lift here. I think this might be a bit more complicated than it seems off hand. But maybe its lots of not-so-complicated refactoring in areas that decide "is this a nap?" (as opposed to fewer, more complicated changes).

I feel like there is some reason we took this approach (i.e. with our babies) initially but I'm not recalling it.

@cdubz cdubz added the enhancement Feature requests or improvements to existing functionality label Oct 25, 2021
@codisart
Copy link
Contributor

Hello, I would be interested to try to implement this feature for hacktoberfest. If I read the code correctly, nap was not a database information, so it would need a database migration, would you prefer a feature branch and several commits ?

@cdubz
Copy link
Member

cdubz commented Oct 27, 2021

Hi @codisart 👋 -- you have it correct. Whether a Sleep instance is a nap is currently calculated based on the NAP_START_MIN and NAP_START_MAX environment variables. So yes this would need changes to the Sleep model and a database migration. The migration may be a bit complex in that, in addition to adding the field, it should probably also look at all instances and set the nap field value based on the NAP_START_MIN and NAP_START_MAX values.

And yes please fork and make commits to a branch.

codisart added a commit to codisart/babybuddy that referenced this issue Oct 27, 2021
@codisart
Copy link
Contributor

Would we want to have the napping concept displayed in the sleep pattern report ?

@cdubz
Copy link
Member

cdubz commented Oct 27, 2021

I can't recall at the moment -- if it is already there yes we'll want to maintain that. if not, no need to add as part of this work.

codisart added a commit to codisart/babybuddy that referenced this issue Oct 27, 2021
codisart added a commit to codisart/babybuddy that referenced this issue Oct 27, 2021
codisart added a commit to codisart/babybuddy that referenced this issue Oct 28, 2021
@cdubz cdubz mentioned this issue Aug 4, 2022
14 tasks
@cdubz
Copy link
Member

cdubz commented Aug 4, 2022

Closing in favor of tracking in #513.

@cdubz cdubz closed this as completed Aug 4, 2022
@cdubz cdubz removed the enhancement Feature requests or improvements to existing functionality label Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants