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

Change hebrew date at sunset #17449

Merged
merged 6 commits into from Oct 30, 2018

Conversation

Projects
None yet
5 participants
@tsvi
Contributor

tsvi commented Oct 14, 2018

Description:

The hebrew date should change at sunset

Related issue (if applicable): N/A

Pull request in home-assistant.io with documentation (if applicable): N/A

Example entry for configuration.yaml (if applicable):

N/A

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

If user exposed functionality or configuration variables are added/changed:
N/A
If the code communicates with devices, web services, or third-party tools:
N/A

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.

@wafflebot wafflebot bot added the in progress label Oct 14, 2018

@tsvi tsvi force-pushed the tsvi:change_hebrew_date_at_sunset branch 2 times, most recently from f30967d to d89f6ba Oct 15, 2018

@houndci-bot

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/linters/.local/bin/flake8", line 7, in 
    from flake8.main.cli import main
ModuleNotFoundError: No module named 'flake8'

@tsvi tsvi changed the title from WIP: Change hebrew date at sunset to Change hebrew date at sunset Oct 28, 2018

@houndci-bot

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/linters/.local/bin/flake8", line 7, in 
    from flake8.main.cli import main
ModuleNotFoundError: No module named 'flake8'
@houndci-bot

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/linters/.local/bin/flake8", line 7, in 
    from flake8.main.cli import main
ModuleNotFoundError: No module named 'flake8'

@tsvi tsvi force-pushed the tsvi:change_hebrew_date_at_sunset branch from 9297f7e to c28aa69 Oct 29, 2018

@houndci-bot

Some files could not be reviewed due to errors:

Traceback (most recent call last):
Traceback (most recent call last):
  File "/home/linters/.local/bin/flake8", line 7, in 
    from flake8.main.cli import main
ModuleNotFoundError: No module named 'flake8'
upcoming_saturday = today + timedelta((12 - today.weekday()) % 7)
sunset = dt_util.as_local(get_astral_event_next(

This comment has been minimized.

@balloob

balloob Oct 29, 2018

Member

I am not sure why you would use start of local day, and then add 24 hours if it's before now? Why not just pass now to event_next?

@tsvi

This comment has been minimized.

Contributor

tsvi commented Oct 30, 2018

@balloob What I'm trying to do is as follows:

  • get today's sunset (since we might be after sunset, I take the one matching start of day)
  • If we're after the sunset I increment today by one, since the Hebrew calendar changes at sunset.

Thinking of it again maybe get_astral_event_date makes more sense in this case?

@balloob

This comment has been minimized.

Member

balloob commented Oct 30, 2018

Ah, I think you're right. I thought you just wanted to get the next sunset. Changing back is fine.

@balloob

balloob approved these changes Oct 30, 2018 edited

Whatever @tsvi decides next is fine 👍 can merge when build passes.

@balloob balloob merged commit 87bd2a3 into home-assistant:dev Oct 30, 2018

5 checks passed

Hound No violations found. Woof!
WIP ready for review
Details
cla-bot Everyone involved has signed the CLA
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.08%) to 93.015%
Details

@wafflebot wafflebot bot removed the in progress label Oct 30, 2018

@tsvi tsvi deleted the tsvi:change_hebrew_date_at_sunset branch Oct 30, 2018

@balloob balloob referenced this pull request Nov 9, 2018

Merged

0.82 #18335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment