Fix inverted and missing feature checks in lock and lawn mower#53222
Draft
piitaya wants to merge 1 commit into
Draft
Fix inverted and missing feature checks in lock and lawn mower#53222piitaya wants to merge 1 commit into
piitaya wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Three feature checks that let the UI dispatch services core rejects.
Lock —
state-card-lockrenders the open button when the lock does not supportLockEntityFeature.OPEN. Supporting locks get no button, non-supporting ones get a button that callslock.openand raises. The Polymer original usedhidden$="[[!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 mower —
more-info-lawn_mowerguards the icon and label onPAUSE, but_handleStartPausebranches onisMowing()alone, so a START_MOWING-only mower shows "Start mowing" while mowing and callslawn_mower.pause. Extracted a_showPausegetter used by the icon, label, service branch and disabled state._startPauseDisabledalso never checkedSTART_MOWING, so a PAUSE-only mower rendered an enabled button callinglawn_mower.start_mowing. Same gap on the start branch ofLAWN_MOWER_COMMANDS_BUTTONS.Core gates all of these:
lock.openonLockEntityFeature.OPEN,lawn_mower.start_mowingonSTART_MOWING,lawn_mower.pauseonPAUSE.Screenshots
Type of change
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed:
To help with the load of incoming pull requests: