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

Add next new moon and next full moon dates to moon integration #32642

Closed

Conversation

SoftXperience
Copy link
Contributor

Proposed change

Add the dates of the next new moon and next full moon as attributes of moon integration

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests
# Example configuration.yaml

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@probot-home-assistant
Copy link

Hey there @fabaff, mind taking a look at this pull request as its been labeled with a integration (moon) you are listed as a codeowner for? Thanks!

Comment on lines +122 to +134
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
Copy link
Member

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.

Copy link
Member

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.

Copy link
Member

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 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Waiting for merge...

Copy link
Member

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 :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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?

Copy link
Member

@MartinHjelmare MartinHjelmare Apr 15, 2020

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.

@springstan springstan added the waiting-for-upstream We're waiting for a change upstream label Mar 13, 2020
@stale
Copy link

stale bot commented Apr 14, 2020

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.
Thank you for your contributions.

@stale stale bot added stale and removed stale labels Apr 14, 2020
@MartinHjelmare
Copy link
Member

I'll close here for now until the upstream PR is merged:
#32642 (comment)

@lock lock bot locked and limited conversation to collaborators Apr 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
integration: moon waiting-for-upstream We're waiting for a change upstream
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants