Skip to content

Refresh now() templates on second=0#42225

Merged
bramkragten merged 2 commits intohome-assistant:devfrom
amelchio:now-on-0
Oct 22, 2020
Merged

Refresh now() templates on second=0#42225
bramkragten merged 2 commits intohome-assistant:devfrom
amelchio:now-on-0

Conversation

@amelchio
Copy link
Contributor

@amelchio amelchio commented Oct 22, 2020

Breaking change

Proposed change

Beta feedback on #41147 is that it would be better if now() causes templates to refresh when the minute changes. This will be more useful for example for comparisons with input_datetime and it is also easier to debug things when you know when to expect the change.

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 entry for configuration.yaml:

# Example configuration.yaml

Additional information

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

To help with the load of incoming pull requests:

Copy link
Member

@bdraco bdraco left a comment

Choose a reason for hiding this comment

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

Tested and working as expected. Thanks 👍

I'll get a frontend PR going since the phrasing will need to be updated.

@amelchio
Copy link
Contributor Author

Great, thanks. We should probably also update the Breaking Change in #41147.

I will look at updating the documentation, I think we missed that with #41147. I plan to mostly remove the text about working without entities and just add a note that now() updates each minute.

@amelchio
Copy link
Contributor Author

Updated documentation: home-assistant/home-assistant.io#15360

@bdraco
Copy link
Member

bdraco commented Oct 22, 2020

Updated documentation: home-assistant/home-assistant.io#15360

Nice. I forgot to actually put in the PR 🤦 when updating #41147. I'll check my local branch that is still useful and see if there is anything as soon as I have a free moment.

@bdraco
Copy link
Member

bdraco commented Oct 22, 2020

I updated the breaking change section in #41147

@bramkragten bramkragten merged commit cb0c937 into home-assistant:dev Oct 22, 2020
balloob pushed a commit that referenced this pull request Oct 22, 2020
@acshef
Copy link
Contributor

acshef commented Oct 28, 2020

The 0.117 release blogpost claims,

Please note, if you have a time-based template where you do not want it to update periodically it will now have to be reworked to not use now().

But there are no recommendations or links on how to do that. ☹

@colormodzz

This comment has been minimized.

@amelchio
Copy link
Contributor Author

@acshef We don't know what to recommend because we have no examples where this would be needed. It will in any case depend on the template, there is no recipe.

As it is really a support question please ask in the forum – but feel free to tag me and I will have a look.

@home-assistant home-assistant locked as resolved and limited conversation to collaborators Oct 29, 2020
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.

7 participants