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

Replace input for number with slider. #35

Open
vandalon opened this issue Apr 13, 2021 · 11 comments
Open

Replace input for number with slider. #35

vandalon opened this issue Apr 13, 2021 · 11 comments
Assignees
Labels
blueprint An issue related to a blueprint enhancement New feature or request

Comments

@vandalon
Copy link
Contributor

I think it would be nice to replace numeral inputs with sliders.
This way the interface works nicer on tablets and phones.
If you agree i'm happy to make a pull request for this :)

@vandalon vandalon added the bug Something isn't working label Apr 13, 2021
@EPMatt EPMatt added enhancement New feature or request and removed bug Something isn't working labels Apr 14, 2021
@EPMatt
Copy link
Owner

EPMatt commented Apr 14, 2021

Hi @vandalon, thank you for the suggestion. :)

When developing these blueprints for the first time I was worried that using sliders might worsen the usability of the user interface, especially if you have to finely tune an input value and the range is quite large.

How's the user experience of such visual controls on a phone or tablet in your opinion? Are you able to precisely tune blueprint numeric inputs?

Moreover, I noticed an interesting idea you used in your contributions: increasing the step value for inputs such as delays etc. where a precise value is not required. Increasing the step value would reduce the number of steps in the slider and improve usability. Definitely something which we should consider. :)

@EPMatt EPMatt added the blueprint An issue related to a blueprint label Apr 15, 2021
@EPMatt EPMatt changed the title [EHANCEMENT] Replace input for number with slider. Replace input for number with slider. Apr 15, 2021
@vandalon
Copy link
Contributor Author

When using the slider, there is still an input box, so you have both options, that's why I like it :)
Using the step value makes it easy to make precise tuning possible :)

@EPMatt
Copy link
Owner

EPMatt commented Apr 16, 2021

Definitely a good choice then.👍🏻

Maybe before starting working on this improvement we should group here the numeric inputs which need to be changed - and propose the new step value for them.
This way once we have the PR we can merge it without having to discuss changes. :)
What do you think about it?

@vandalon
Copy link
Contributor Author

sounds good to me :)

@EPMatt
Copy link
Owner

EPMatt commented Apr 17, 2021

Ok so, here are numeric inputs I found on existing blueprints, and my proposal for the new step values for them:

  • Controllers:
    • helper_double_press_delay: 50
  • Light Hook:
    • light_transition: 50
    • min_brightness: 1
    • max_brightness: 1, I'd change the min value to 1
    • brightness_steps_short: 1
    • brightness_steps_long: 1
    • on_brightness: 1, I'd change the min value to 1
  • Media Player Hook:
    • volume_steps_short: 1
    • volume_steps_long: 1

Let me know what you think. :)

@vandalon
Copy link
Contributor Author

vandalon commented Apr 18, 2021

All nr inputs that have a min and max defined would qualify no? :)
i would set transition to 100ms even 50ms is really not noticeable i think.
brightness values should be 1, I agree
short brightness steps of 1 are also not noticeable. I would say at least 5 there.
on_brightness also agreed :)

For media volume i have another idea because the problem with audio is that small steps matter when the volume is low, but small steps on higher volume are not noticeable. I did the following in my automation:

                  volume_level: >-
                    {% set volume_step %} {% if
                    state_attr("media_player.woonkamer","volume_level") < 0.05
                    %}0.01 {% elif
                    state_attr("media_player.woonkamer","volume_level") < 0.12
                    %}0.03 {% else %}0.05{% endif %} {% endset %} {{ [
                    state_attr("media_player.woonkamer","volume_level") +
                    volume_step | float ,0.8 ] | min  }}

@EPMatt
Copy link
Owner

EPMatt commented Apr 19, 2021

All nr inputs that have a min and max defined would qualify no? :)

Yes :)

i would set transition to 100ms even 50ms is really not noticeable i think.

I agree on setting transitions steps to 100ms, but we also have to take care of the default value for some of them (currently 250, should be increased to 300).

brightness values should be 1, I agree
short brightness steps of 1 are also not noticeable. I would say at least 5 there.

I'd prefer to leave this to 1. Users might need to set a really low value since not all lights react at the same way, and some of them might need a finer control (especially really powerful lights).

on_brightness also agreed :)

For media volume i have another idea because the problem with audio is that small steps matter when the volume is low, but small steps on higher volume are not noticeable. I did the following in my automation:

                  volume_level: >-
                    {% set volume_step %} {% if
                    state_attr("media_player.woonkamer","volume_level") < 0.05
                    %}0.01 {% elif
                    state_attr("media_player.woonkamer","volume_level") < 0.12
                    %}0.03 {% else %}0.05{% endif %} {% endset %} {{ [
                    state_attr("media_player.woonkamer","volume_level") +
                    volume_step | float ,0.8 ] | min  }}

Interesting idea! This requires to add additional inputs to the Media Player Hook, hence we might consider it later as a separate feature. For now I think we can keep it simple and only update configuration for existing inputs. :)

Thank you for your feedback! I'm proceeding with implementing the suggested changes. :)

@EPMatt
Copy link
Owner

EPMatt commented Apr 19, 2021

If you agree i'm happy to make a pull request for this :)

@vandalon I'm sorry, I confused this issue with the one you left me a few days ago. :D
Are you going to work on this too? Just let me know. :)

Thanks!

@vandalon
Copy link
Contributor Author

Interesting idea! This requires to add additional inputs to the Media Player Hook, hence we might consider it later as a separate feature. For now I think we can keep it simple and only update configuration for existing inputs. :)

Actually i have an idea that would not need extra inputs. Will try and make something for that later :)

@vandalon
Copy link
Contributor Author

vandalon commented Apr 19, 2021

If you agree i'm happy to make a pull request for this :)

@vandalon I'm sorry, I confused this issue with the one you left me a few days ago. :D
Are you going to work on this too? Just let me know. :)

Thanks!

Go right ahead:) i had my hands full on the 2 controllers and the ha bug 😀

@EPMatt EPMatt self-assigned this Apr 19, 2021
@EPMatt
Copy link
Owner

EPMatt commented Apr 19, 2021

Go right ahead:) i had my hands full on the 2 controllers and the ha bug 😀

Great, thank you. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blueprint An issue related to a blueprint enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants