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

Jewish calendar binary sensor #26200

Merged
merged 39 commits into from Sep 6, 2019

Conversation

@tsvi
Copy link
Contributor

commented Aug 25, 2019

Breaking Change:

Change in configuration.yaml

sensor:
  - platform: jewish_calendar
    sensors:
       - date
       - ...

To

jewish_calendar:

Automations based on sensor.issur_melacha_in_effect comparison to True/False need to be updated to use binary_sensor.issur_melacha_in_effect on and off states.

Explanation

  • Move Jewish calendar sensor to its own platform
  • Split sensors into sensors and binary sensors
  • Removal of the "sensors" key, following ADR003 removing data selectors, instead show all of the sensors.

The issur_melacha_in_effect was supposed to be a binary sensor. I wasn't aware of the distinction back when I first developed this integration. This fixes this issue by creating a new platform, supporting both types of sensors.

Description:

Make Jewish calendar its own platform with two types of sensors: sensor and binary sensor. In a future PR I plan to split the sensor furthermore in data and time related so that I can provide datetime attributes in the same fashion as the date sensor. This will provide easier ways of writing automations.

Related issue (if applicable): fixes #20315
As part of this change, I implemented @MartinHjelmare suggestion for testing the components,

Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#10231

Example entry for configuration.yaml (if applicable):

jewish_calendar:
  language: hebrew
  diaspora: False

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist

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. Update and include derived files by running python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt by running python3 -m script.gen_requirements_all.

If the code does not interact with devices:

  • Tests have been added to verify that the new code works.
@project-bot project-bot bot added this to Needs review in Dev Aug 25, 2019
@MartinHjelmare MartinHjelmare moved this from Needs review to Incoming in Dev Aug 26, 2019
@tsvi tsvi force-pushed the tsvi:jcal_binary_sensor branch from 8d5352b to 085866e Aug 26, 2019
tsvi added a commit to tsvi/home-assistant.github.io that referenced this pull request Aug 26, 2019
@tsvi tsvi referenced this pull request Aug 26, 2019
2 of 2 tasks complete
@tsvi tsvi changed the title WIP: Jewish calendar binary sensor Jewish calendar binary sensor Aug 28, 2019
homeassistant/components/jewish_calendar/__init__.py Outdated Show resolved Hide resolved
Dev automation moved this from Incoming to Review in progress Aug 28, 2019
@tsvi tsvi force-pushed the tsvi:jcal_binary_sensor branch 2 times, most recently from 6d0af80 to b105c7d Aug 29, 2019
@tsvi

This comment has been minimized.

Copy link
Contributor Author

commented Sep 3, 2019

Finally got all the tests to pass. @MartinHjelmare any more fixes necessary?

tsvi added 10 commits Aug 22, 2019
As part of this, move tests to use async_setup_component instead of
testing JewishCalendarSensor as suggested by @MartinHjelmare here:

#24958 (review)
…_time_zone in tests
@tsvi tsvi force-pushed the tsvi:jcal_binary_sensor branch from 6886e4e to 879e2f6 Sep 3, 2019
Copy link
Member

left a comment

Looks good!

Dev automation moved this from Review in progress to Reviewer approved Sep 3, 2019
@tsvi

This comment has been minimized.

Copy link
Contributor Author

commented Sep 3, 2019

Fixed the imports as requested

@tsvi

This comment has been minimized.

Copy link
Contributor Author

commented Sep 3, 2019

I think we need a breaking change label here.

@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Sep 3, 2019

Please add to the breaking change paragraph what the user needs to do to cope with the breaking change.

@tsvi

This comment has been minimized.

Copy link
Contributor Author

commented Sep 6, 2019

@MartinHjelmare can you merge the PR? Or are we waiting for another review?

@MartinHjelmare

This comment has been minimized.

Copy link
Member

commented Sep 6, 2019

We're all good! Changing the PR description doesn't generate a github notification.

@MartinHjelmare MartinHjelmare merged commit 815e7a7 into home-assistant:dev Sep 6, 2019
12 checks passed
12 checks passed
CI Build #20190903.85 succeeded
Details
CI (FullCheck Mypy) FullCheck Mypy succeeded
Details
CI (FullCheck Pylint) FullCheck Pylint succeeded
Details
CI (Overview CheckFormat) Overview CheckFormat succeeded
Details
CI (Overview Lint) Overview Lint succeeded
Details
CI (Overview Validate) Overview Validate succeeded
Details
CI (Tests PyTest Python36) Tests PyTest Python36 succeeded
Details
CI (Tests PyTest Python37) Tests PyTest Python37 succeeded
Details
cla-bot Everyone involved has signed the CLA
codecov/patch 98.63% of diff hit (target 93.98%)
Details
codecov/project 93.98% (target 90%)
Details
docs-missing Documentation ok.
Dev automation moved this from Reviewer approved to Done Sep 6, 2019
@lock lock bot locked and limited conversation to collaborators Sep 7, 2019
@tsvi tsvi deleted the tsvi:jcal_binary_sensor branch Sep 11, 2019
@tsvi tsvi restored the tsvi:jcal_binary_sensor branch Sep 11, 2019
@tsvi tsvi deleted the tsvi:jcal_binary_sensor branch Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Dev
  
Done
3 participants
You can’t perform that action at this time.