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

Fix slider tap mobile #14

Draft
wants to merge 74 commits into
base: main
Choose a base branch
from

Conversation

lizsugar
Copy link
Collaborator

@lizsugar lizsugar commented Jun 2, 2022

Resolves an issue on mobile where tapping needed to be incredibly precise (only my android phone, tapping on my surface worked fine - the touch interfaces must interpret interaction slightly differently).

Fixes a bug in #10 but is a separate branch because it needed features from #5 to implement the fix.

Submitting as a draft PR because this is also doing that thing where a million commits from main branch are being included. The only commits needed are da8a4ec and d0b744f

lizsugar and others added 30 commits April 9, 2022 15:00
Makes it more visually distinguishable
Just uses the switch controller to toggle the automation on and off
Mouse or touch event can now continue outside of card bounds to continue
adjusting the slider by relative position change.  This is incredibly
helpful on small mobile displays.
Just uses the switch controller to toggle the automation on and off
Mouse or touch event can now continue outside of card bounds to continue
adjusting the slider by relative position change.  This is incredibly
helpful on small mobile displays.
Plus some default settings based on card type
FIX: No longer triggers the tap_action when sliding!
BUG: does not trigger tap_action unless slider is disabled
It is supposed to trigger tap_action at all times.

The goal is that this change will eventually result in "Act as a toggle (disable
sliding)" being removed. A toggle for disabling slider will remain, but
it will no longer add a tap action for toggle when enabled, as that will be attached to the
slider anyway (and can be defined as 'none' action if desired).
GUI and YAML options added, english translation added

Current bugs: if attribute value is too long, then state and attribute will
not stay on the same line.
Outstanding bug: Rounding error when input_number step is set to certain values (observed easily with step set to 2 or 3)
lizsugar added 29 commits May 13, 2022 13:28
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.
Modified all git URLs to point to this repo as appropriate
Table formatting
Updated and added config options
Added new examples and example screenshots where appropriate
Credited myself where appropriate
Clarify credit to @rohankapoorcom
A little bit of a dirty fix, but it works
Makes this work more reliably on mobile where touch always has some movement
behind it
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.

1 participant