Skip to content

Rename timer last_action to last_transition#169430

Merged
emontnemery merged 1 commit into
devfrom
rename_timer_last_action
Apr 29, 2026
Merged

Rename timer last_action to last_transition#169430
emontnemery merged 1 commit into
devfrom
rename_timer_last_action

Conversation

@emontnemery
Copy link
Copy Markdown
Contributor

Proposed change

Rename timer last_action to last_transition

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)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • 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
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

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.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

"name": "Finishes at"
},
"last_transition": {
"name": "Last transition",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure this is understandable?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think it's good. It's better than last action as we didn't include all actions in last action.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR renames the Timer entity state attribute last_action to last_transition in the timer integration, updating the integration code, tests, and UI strings accordingly.

Changes:

  • Renamed the timer attribute constant and internal field from last_action to last_transition.
  • Updated timer tests to assert on last_transition instead of last_action.
  • Added translation strings for the new last_transition state attribute (including value labels like started/paused/etc).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
homeassistant/components/timer/__init__.py Renames the exposed state attribute and the internal tracking field to last_transition, and updates restore logic accordingly.
homeassistant/components/timer/strings.json Adds translated name + value labels for the new last_transition attribute.
tests/components/timer/test_init.py Updates all assertions and a couple of test names/docstrings to use last_transition.

Comment thread homeassistant/components/timer/__init__.py
Comment thread homeassistant/components/timer/__init__.py
Comment thread homeassistant/components/timer/__init__.py
Comment thread tests/components/timer/test_init.py
@emontnemery
Copy link
Copy Markdown
Contributor Author

The bot comments about this being a breaking change are technically correct, but the last_action state attribute has only been on dev for a couple of hours so we don't need to treat it as breaking.

@emontnemery emontnemery merged commit b4bfe6b into dev Apr 29, 2026
52 checks passed
@emontnemery emontnemery deleted the rename_timer_last_action branch April 29, 2026 09:35
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 30, 2026
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.

3 participants