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

Fix US states check (fixes #7015) #7017

Merged
merged 1 commit into from
Apr 10, 2017
Merged

Fix US states check (fixes #7015) #7017

merged 1 commit into from
Apr 10, 2017

Conversation

fabaff
Copy link
Member

@fabaff fabaff commented Apr 10, 2017

Description:

For the US there are STATES while for other countries PROVINCES is used.

Related issue (if applicable): fixes #7015

Example entry for configuration.yaml (if applicable):

binary_sensor:
  - platform: workday
    country: US
    province: WA

Checklist:

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

  • [] Local tests with tox run successfully. Your PR cannot be merged unless tests pass

@mention-bot
Copy link

@fabaff, thanks for your PR! By analyzing the history of the files in this pull request, we identified @BastianPoe to be a potential reviewer.

@drkp
Copy link
Contributor

drkp commented Apr 10, 2017

This isn't enough, it looks like you also need to use state= instead of prov= (line 76) in order to get holidays to return the state-specific info. With prov, it just ignores the value (ugh!):

>>> len(holidays.US(years=2017))
12
>>> len(holidays.US(years=2017, state="CA"))
14
>>> len(holidays.US(years=2017, prov="CA"))
12

balloob pushed a commit that referenced this pull request Apr 11, 2017
@balloob balloob mentioned this pull request Apr 11, 2017
@balloob
Copy link
Member

balloob commented Apr 11, 2017

Cherry picked for 0.42.3

@balloob balloob mentioned this pull request Apr 21, 2017
@home-assistant home-assistant locked and limited conversation to collaborators Jul 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

binary_sensor.workday doesn't support US states
7 participants