-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Add next new moon and next full moon dates to moon integration #32642
Add next new moon and next full moon dates to moon integration #32642
Conversation
astral = Astral() | ||
end = today + timedelta(days=31) | ||
new_moon = None | ||
full_moon = None | ||
for i in range((end - today).days): | ||
day = today + timedelta(days=i) | ||
phase = round(astral.moon_phase(date=day, rtype=float), 0) | ||
if phase == 0: | ||
new_moon = day | ||
if phase == 14: | ||
full_moon = day | ||
if new_moon is not None and full_moon is not None: | ||
break |
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.
IMHO this should be moved to astral
since it is not HA specific.
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.
Yes, that should be part of astral
.
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.
Therefore, please open a PR upstream to update astral
, thanks 👍
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.
Done. Waiting for merge...
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.
Great! Could you link the PR so we can track it as well? Thanks :)
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.
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.
So, there is no reaction on the MR in the upstream. What next?
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.
We can continue here when the upstream PR is merged. For now I suggest we close this PR. Please open a new PR when the upstream PR is merged.
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
I'll close here for now until the upstream PR is merged: |
Proposed change
Add the dates of the next new moon and next full moon as attributes of moon integration
Type of change
# Example configuration.yaml
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale: