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

Feature - Weeks remain #20

Closed
poudenes opened this issue Oct 3, 2024 · 7 comments
Closed

Feature - Weeks remain #20

poudenes opened this issue Oct 3, 2024 · 7 comments
Assignees

Comments

@poudenes
Copy link

poudenes commented Oct 3, 2024

Great great integration!!!

To make it fully complete it would be great to have: weeks remain as attribute.

Keep up the good work!

@Miicroo
Copy link
Owner

Miicroo commented Oct 3, 2024

Nice, thanks for the suggestion @poudenes ! Some quick questions so I can tailor the solution a bit better, do you have a lot of birthdays and are all shown in a list, or do you just use the next birthday and want to know how many weeks out that is? Since it is weeks remaining (so state divided by 7) it could be possible to have it templated, and if so also bring in some way of making custom attributes based on a template

@poudenes
Copy link
Author

poudenes commented Oct 3, 2024

The answer is to know how many weeks till the birthday. Templating a sensor is an options. But if it can be integrated in the integrations as attribute would be nicer :)

@Miicroo
Copy link
Owner

Miicroo commented Oct 3, 2024 via email

@Miicroo
Copy link
Owner

Miicroo commented Oct 8, 2024

PR is on its way! #21
Will do some final testing and can add the config you need here when it is done :)

@Miicroo
Copy link
Owner

Miicroo commented Oct 8, 2024

@poudenes v1.1.0 is released now, here is how you should configure it to add a custom templated attribute so you get weeks_until_birthday for each birthday. You have to change the birthdays-list though, I just added it so that you can see what it should look like

birthdays:
  config:
    attributes:
      weeks_until_birthday: '{{ ((this.state or -1) / 7) | int }}'
  birthdays:
    - name: 'Frodo Baggins'
      date_of_birth: 1921-09-22
    - name: 'Bilbo Baggins'
      date_of_birth: 1843-09-22
    - name: Elvis
      date_of_birth: 1935-01-08
      icon: 'mdi:music'

Let me know if you have any questions!

@Miicroo Miicroo self-assigned this Oct 8, 2024
@poudenes
Copy link
Author

poudenes commented Oct 9, 2024

Updated and worked great!

@Miicroo
Copy link
Owner

Miicroo commented Oct 10, 2024

Super, closing the issue now! :)

@Miicroo Miicroo closed this as completed Oct 10, 2024
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

2 participants