-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Cover position tile feature #16110
Cover position tile feature #16110
Conversation
rollback changes done by VS Code
sure, but in a future PR :) let's add features one by one. |
@@ -38,6 +39,7 @@ type SupportsFeature = (stateObj: HassEntity) => boolean; | |||
|
|||
const FEATURE_TYPES: FeatureType[] = [ | |||
"cover-open-close", | |||
"cover-position", |
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.
The naming convention for cover-features needs a rework if we introduce tilt-sliders.
Maybe the position feature should be called "cover-position-slider"?
.value=${value} | ||
min="0" | ||
max="100" | ||
.step="1" |
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.
The default value of step in ha-control-slider.ts is 1. Why should we be explicit here?
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.
I was wondering if the cover has the option to set the step to a different value, but I didn't find this.
So if there is no such option we can remove this line.
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.
I assume you are using the Demo Integration in the development environment to test this feature.
The demo covers provided by the Demo integration cannot be set to single percent values.
Here you can see that the target position (same goes for tilt) is rounded in 10 percent steps.
If you go from 20% to 21% percent the demo cover will close/open fully as a result of rounding the value (this behavior could be considered a bug).
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.
@TillFleisch I had a hard time trying to use my HA instance with the frontend during the development, so yes, I set up a new instance in dev containers and used the demo integration.
But the idea behind the step was to allow the user to customize the step size, but let's remove that for now.
If we change the PR title to "Cover tile slider features", I think it's fine. |
@piitaya as you are the author of tiles and features, can I kindly ask you for a review? I want to get this into the next release. |
The cover position slider is inverted in the more-info dialog (to looks like a real shutter or garage) because cover are mostly closed when position is at the bottom and open when position is at the top. I don't know how we can reflect this behavior in the horizontal tile. With your proposal, the cover is open when slider is fully colored. That's not the case in the more info dialog. |
@piitaya thank you for the fast feedback. |
@piitaya if I understand correctly, the user will be able to select if he wants to have the slider inverted, so the user will decide if the position on the left means the cover is closed or opened. |
The slider will represent the shutter and not the opening percentage like we have in the more info |
@Misiu And yes, tilt cover position should be a separate feature. You can open it if you want otherwise I will do it 🙂 |
I don't have that much free time lately so I'm not sure when I'll be able to create that feature, so this might not get added in 2023.9, but I'm sure you'll add it in no time :) About the position control, I disagree, that the close should be on the right. Maybe an option to invert the logic? But isn't that added in 8f62671? |
I see your point. For Home assistant, position 0% = closed and position 100% open like any other system. |
Not sure what would be the best solution. |
I don't understand why it solves confusion. In one case, the slider will be inverted with more info. |
The active zone should be the same for more-info and tile feature because visually it's the same element : a slider with handle. If we choose to color the closed part on more info, it must be the same on tile card. |
That's a valid argument 🙂 Adding a way to pick a direction is an option (the default behavior is the one that is currently in the dev branch), so the user will be able to choose if he wants the different behavior or not. Maybe I'll create a discussion and we'll see what others have to say, hopefully with more attention and user opinions we'll work out something or even convince the UI/UX team to add an option to pick the direction. I can always try to create a custom tile feature and add it as an external JS file. |
@piitaya another proposal that hopefully will change your mind 🙂 I've added:
|
I have awning mounted to the outside of the house. When it is fully closed, the tile card slider is fully to the right and more info dialog fully to the bottom. In both screens slider is fully colored. For me it makes more sense to align this with brightness sliders: |
Breaking change
Proposed change
Add cover position tile feature.
Type of change
Example configuration
Additional information
Checklist
If user exposed functionality or configuration variables are added/changed: