Skip to content

Fix inverted and missing feature checks in lock and lawn mower#53222

Draft
piitaya wants to merge 1 commit into
devfrom
fix-lock-lawn-mower-feature-checks
Draft

Fix inverted and missing feature checks in lock and lawn mower#53222
piitaya wants to merge 1 commit into
devfrom
fix-lock-lawn-mower-feature-checks

Conversation

@piitaya

@piitaya piitaya commented Jul 21, 2026

Copy link
Copy Markdown
Member

Proposed change

Three feature checks that let the UI dispatch services core rejects.

Lockstate-card-lock renders the open button when the lock does not support LockEntityFeature.OPEN. Supporting locks get no button, non-supporting ones get a button that calls lock.open and raises. The Polymer original used hidden$="[[!supportsOpen]]", a hide condition, and the negation was carried over verbatim when it became a show condition in #18257. The two other buttons in the same file were inverted correctly.

Lawn mowermore-info-lawn_mower guards the icon and label on PAUSE, but _handleStartPause branches on isMowing() alone, so a START_MOWING-only mower shows "Start mowing" while mowing and calls lawn_mower.pause. Extracted a _showPause getter used by the icon, label, service branch and disabled state. _startPauseDisabled also never checked START_MOWING, so a PAUSE-only mower rendered an enabled button calling lawn_mower.start_mowing. Same gap on the start branch of LAWN_MOWER_COMMANDS_BUTTONS.

Core gates all of these: lock.open on LockEntityFeature.OPEN, lawn_mower.start_mowing on START_MOWING, lawn_mower.pause on PAUSE.

Screenshots

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • 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 or discussion:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to backend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the perfect PR recommendations
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

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

To help with the load of incoming pull requests:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant