8000 Remove deprecated automation keywords by amelchio · Pull Request #8510 · home-assistant/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Remove deprecated automation keywords #8510 8000

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

Merged
merged 3 commits into from
Jul 17, 2017

Conversation

amelchio
Copy link
Contributor
@amelchio amelchio commented Jul 16, 2017

Description:

The state trigger keyword state and the time trigger keyword after were deprecated in 0.46. I think now is a good time to remove them completely.

For those clicking through looking to fix their HA

Find all platform: state TRIGGERS that use "state:"
Change those to "to:"

Do the same for platform: time TRIGGERS, i.e. change "after:" to "at:"

Note: Only TRIGGERS (not conditions)!

Example:

FROM:

- alias: Garage door opened
  trigger:
    - platform: state
      entity_id: cover.myq
      state: 'open'

TO:

- alias: Garage door opened
  trigger:
    - platform: state
      entity_id: cover.myq
      to: 'open'

Pull request in home-assistant.github.io with documentation (if applicable): home-assistant/home-assistant.io#2997

Checklist:

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

If the code does not interact with devices:

  • Local tests with tox run successfully. Your PR cannot be merged unless tests pass
  • Tests have been added removed to verify that the new code works.

@mention-bot
Copy link

@amelchio, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob, @fabaff and @pvizeli to be potential reviewers.

@amelchio amelchio changed the title [WIP] Remove deprecated automation keywords Remove deprecated automation keywords Jul 17, 2017
@amelchio amelchio requested a review from emlove July 17, 2017 09:23
Copy link
Contributor
@emlove emlove left a comment

Choose a reason for hiding this comment

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

Agree it's been long enough. Let's keep the test though.

'trigger': {
'platform': 'state',
'entity_id': 'test.entity',
'state': 'world'
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's keep this test and just change this to to.

Copy link
< 8000 div class="d-none d-sm-flex"> Contributor Author

Choose a reason for hiding this comment

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

That test already exists in test_if_fires_on_entity_change_with_to_filter or am I missing something?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, you're right. My mistake!

Copy link
Member
@fabaff fabaff left a comment

Choose a reason for hiding this comment

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

🐦

@fabaff fabaff merged commit b83ff73 into home-assistant:dev Jul 17, 2017
@balloob balloob mentioned this pull request Jul 29, 2017
@runraid
Copy link
runraid commented Jul 30, 2017

For those clicking through looking to fix their HA...

Find all TRIGGER CONDITIONS that use "state:"
Change those to "to:"
Note: Only TRIGGER conditions!

Example:

From:

- alias: Garage door opened
  trigger:
    - platform: state
      entity_id: cover.myq
      state: 'open'

TO:

- alias: Garage door opened
  trigger:
    - platform: state
      entity_id: cover.myq
      to: 'open'

@amelchio
Copy link
Contributor Author

Thanks @runraid – I have copied your instructions to the top of this issue to make them more visible, hope you don't mind.

@frekel
Copy link
frekel commented Aug 7, 2017

Given the following config:

    trigger:
      - platform: state
        entity_id: media_player.mediaplayer_kodi
        to: 'playing'
    condition:
      - condition: state
        entity_id: sun.sun
        state: 'below_horizon'

should state: 'below_horizon' also be to: 'below_horizon' ?

@amelchio
Copy link
Contributor Author
amelchio commented Aug 7, 2017

@frekel No. Do not change conditions, only change triggers.

@brianjking
Copy link

@amelchio I'm having trouble identifying what the issue is with my changes to comply with the 0.50.x automation updates. Can you please try and take a look and let me know what file(s) are the issue? brianjking/homeassistant-config#113 (comment)

Thanks so much, really appreciate it...

@arsaboo
Copy link
Contributor
arsaboo commented Aug 9, 2017

@brianjking Please look at the docs little more carefully. No changes to condition....use from and to only in `trigger.

@home-assistant home-assistant locked and limited conversation to collaborators Aug 9, 2017
@emlove
Copy link
Contributor
emlove commented Aug 9, 2017

Please limit PR comments to development discussion. Further config questions can be directed to one of our support channels: https://home-assistant.io/help/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants
0