-
Notifications
You must be signed in to change notification settings - Fork 66
Birthdays #19
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
base: master
Are you sure you want to change the base?
Birthdays #19
Conversation
| _display->drawText(I18N_DAYS[now->tm_wday], FONT_MEDIUM, RIGHT, 394, DisplayGDEW075T7::TOP_RIGHT); | ||
| } | ||
| #endif | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey! Sorry I didn't review this earlier, I kinda took a break from this project. I don't really like the idea of replacing the day with this information because if they're doing a first + last name that could pretty easily overflow the amount of space available. Maybe this could be underneath the chamber icons using FONT_SMALL, and combined with the age in a format like "{name}, {age}"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would also remove the need for the name to be in all caps, since FONT_SMALL contains the full set of uppercase and lowercase characters.
| #include "localization.h" | ||
| #ifdef BIRTHDAYS | ||
| #include "birthday.h" | ||
| Birthday* activeBirthday = nullptr; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't need to be a global
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I put this at this level so it would not import into the project unless defined in config to keep memory lower when not used. Where would you propose this import be moved? I can't move birthday.h into config so not sure where else but global this could be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just talking about the declaration of activeBirthday, not the import. That variable is only used inside the update function so it can be local to that.
| #define BIRTHDAY_1_MONTH 0 | ||
| #define BIRTHDAY_1_DAY 0 | ||
| #define BIRTHDAY_1_YEAR 0 | ||
| #define BIRTHDAY_1_Name "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize name on these just for consistency
| * Define a struct objec to hold birthday data | ||
| */ | ||
| struct Birthday{ | ||
| Birthday(){}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for trivial constructors, you can create structs with this syntax
Birthday birthday = {
.month=1,
.day=2,
.year=2000,
.name="name",
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you referring to only the default constructor or the entire struct definition? The struct isn't in general trivial as it is reused for each birthday for reusability and repeated methods within it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the constructors, not the definition of the struct itself. That code I provided is a c++ syntax for struct instantiation. Both ways work but unless a struct's constructor is actually doing things other than just setting properties I prefer that syntax.
| year = y; | ||
| name = n; | ||
| } | ||
| byte month=0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prefer uint8_t to byte
|
Wouldn't it be cool if the birthdays can be fetched from a caldav server? |
I had a similar thought but haven't gotten back to this. I made the modifications requested for this PR but didn't like how it looked so I kind of let it sit on the back burner. Since then, I've created a separate repo for this to add things that may not directly fit into this display concept. I should be able to finish this PR sometime this wek and add some calendar support, i.e. google calendar, ical and caldav later once the basic concept is accepted. |
Added a birthday option where you can configure up to 4 birthdays (can be increased if necessary) to show a special icon set similar to leap years but instead just shows all cakes. I did my best to keep this as close to the current design and to not veer too far from the portal look and also keep the same style of everything is done from the config.h file. Here is how it looks with all the options.
An active birthday with the show year option:

An active birthday with the show age option (overwrites year):

An active birthday with the show age and name option (overwrites year and weekday):

Back to normal the next day:

Weather always shows normal as it does not care about birthdays:
