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

[feat] Add Support for input_number domain #61

Merged

Conversation

rohankapoorcom
Copy link
Member

@rohankapoorcom rohankapoorcom commented Aug 16, 2023

Creating a new branch and PR since I can't fix the merge conflicts on @lizsugar's original PR (#7). Rebases their branch on top of mainline and then includes includes a doc update.

This adds support for the input_number domain and makes the entities far far easier to manage on a mobile touch display vs. the builtin entities card.

image

One note: There is a current oustanding bug where if the input_number.entity.min value is not cleanly divisible by the input_number.entity.step value, then the slider card is off by an amount. If your input_number has min = 5, max = 25, step = 5 then it will work just fine. But if the step is 2, then it will be off. This also has the side effect of changing the input_number to an "illegal" value when modified via slider-button-card. Step = 1 always works.

If anyone has any insight I would appreciate the help. Otherwise, I am submitting as is, because it is largely functional right now.

Closes #18

Closes #33

lizsugar and others added 6 commits August 15, 2023 17:29
Outstanding bug: Rounding error when input_number step is set to certain values (observed easily with step set to 2 or 3)
… result of both

the step and the max of an input_number entity.

Appears that at this time applyStep() is unnecessary, and was in fact
causing the problem  I have tested stepped sliders of both input_number entities as well as
light and climate entities, and stepping still works as expected when
applyStep() is not called at all.

This does not resolve the issue where step count results in "illegal"
values on certain input_number entities.
@rohankapoorcom rohankapoorcom merged commit c17f74e into custom-cards:main Aug 16, 2023
2 checks passed
@rohankapoorcom rohankapoorcom deleted the lizsugar_input_number branch August 16, 2023 01:00
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

Successfully merging this pull request may close these issues.

Input_number?! How to? Do you have any plans to support input_number? I would love this.
2 participants