Skip to content
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

Invert slider display behaviour #221

Closed
ZTHawk opened this issue Oct 29, 2021 · 3 comments
Closed

Invert slider display behaviour #221

ZTHawk opened this issue Oct 29, 2021 · 3 comments

Comments

@ZTHawk
Copy link

ZTHawk commented Oct 29, 2021

I have covers that are closed with value 0 and open with value 100 (they are following definitions at https://developers.home-assistant.io/docs/core/entity/cover/#platform-properties-to-be-implemented-by-deriving-platform-classes).
I would like to see when moving the slider to the right that the cover is not opening but closing.
So if an invert option is active then:

  • the current position of the slider would be "100 - <current_position cover position>"
  • updating the cover position would be "100 - <current_position of slider>"

It is similar to request #162 but this request does not aim to support "wrong" behaviour of covers, but to give the possibility to change the behaviour of the slider itself.

This inverted behaviour makes more sense from the cover visibility point of view:
When cover is fully open then it means that the cover is not visible (= 0).
When the cover is closed then it means that the cover is fully visible (= 100).

It seems that pull request #134 is doing what I am requesting.

@thomasloven
Copy link
Owner

Maybe the new dir option in 17.2.0 will do what you want?

@thomasloven
Copy link
Owner

Otherwise, this is what you want https://www.home-assistant.io/integrations/cover.template/

@ZTHawk
Copy link
Author

ZTHawk commented Oct 31, 2021

Option "dir" will just mirror the slider but the values are all the same and you have to move the slider from right to left. This is a weird behaviour.

Solution

I ended up with forking this repo and implementing it based on the pull request #134 (with some fixes).
For those that need this feature just add a custom repository to HACS "https://github.com/ZTHawk/lovelace-slider-entity-row" and replace the original one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants