-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Covers - Removed disable buttons #356
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
Conversation
Allow commands being send even if cover is open or closed. Important for cover template when using multiple covers or in end positions when cover registered as open/closed but isn't due to tolerance.
I think the disabled buttons are nice. I don't think the 1st reason is valid. A proper implementation would be using The 2nd reason is valid though, but maybe it should be configurable ;) |
@andrey-git In my option the I personally wouldn't mind having the buttons always enabled, that's why I proposed the change. I would certainly be ok with this being an option in the config. Another idea could be to also display the position next to the controls (also as an configurable). I will see if I get this to work in the next few days and later maybe and own compontent to control multiple covers. |
We should not remove the disabled state, it's a nice indicator on the state of the cover. We also should not decrease functionality for other platforms to add support for "a not ideal workaround for controlling more than one cover". However, what would be fine is that when |
<paper-icon-button icon="mdi:arrow-up" on-tap='onOpenTap' | ||
invisible$='[[!entityObj.supportsOpen]]'></paper-icon-button> | ||
</template> | ||
<template is='dom-if' if='[[!entityObj.assumeState]]'> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of duplicating the dom element - make a function that will decide whether the button should be disabled.
I couldn't test the ones for the tilt covers, but they should be fine.
src/util/cover-model.html
Outdated
return this.stateObj.attributes.assumed_state === true; | ||
}); | ||
|
||
addGetter('disableButtonFullyOpen', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not add these to the cover model as they are very specific to the component where they are used. They should be computed inside the component instead.
<paper-icon-button icon="mdi:stop" on-tap='onStopTap' | ||
invisible$='[[!entityObj.supportsStop]]'></paper-icon-button> | ||
<paper-icon-button icon="mdi:arrow-down" on-tap='onCloseTap' | ||
invisible$='[[!entityObj.supportsClose]]' | ||
disabled='[[entityObj.isFullyClosed]]'></paper-icon-button> | ||
disabled='[[entityObj.disableButtonFullyClosed]]'></paper-icon-button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't add this to entityObj. Compute it in component instead: `disabled='[[computeCloseDisabled(stateObj, entityObj]]'
🎉 thanks |
* Cover - Added doc customize Added `assume_state` to customize section. home-assistant/frontend#356 * Update cover.markdown
Allow commands being send even if cover is open or closed. Important for cover template when using multiple covers or in end positions when cover registered as open/closed but isn't due to tolerance.
Example for multiple covers: home-assistant/home-assistant.io#3013