lovelace-mushroom icon indicating copy to clipboard operation
lovelace-mushroom copied to clipboard

An input_select card

Open fnoir opened this issue 2 years ago • 10 comments

It is necessary to make two actions for the input_select which is not very practical to use especially on a tablet.

input_select:
  who_cooks:
    name: Who cooks today
    options:
      - Paulus
      - Anne Therese
    initial: Anne Therese
    icon: mdi:panda

image

image

To improve its use, it would be necessary to add the possibility of changing options directly from the card, such as a list of buttons like shutters' card

image

fnoir avatar Feb 18 '22 11:02 fnoir

image

(credit: the_code#6829)

zsarnett avatar Feb 18 '22 20:02 zsarnett

@zsarnett This would be considered a radio input over an input select wouldn't it? Either way I like this approach with having active states shown on cards with an easy tap to change things.

brandensilva avatar Feb 18 '22 22:02 brandensilva

There is no such thing as a radio input. The setup for a radio input is the same as a select. You can only choose one value

zsarnett avatar Feb 18 '22 22:02 zsarnett

Sorry, I should clarify where I was going with it.

In HTML you can have a select input and you can have an input with type="radio". While these serve one purpose of getting to one value, they function differently because there are differences.

The interactive difference is a select dropdown requires two interaction points and a radio input only requires one. I don't think this difference should be ignored as the issue raised here is that a select-like dropdown doesn't work for his tablet use case and a radio-like input is a better option. You demonstrated this well with your screenshot.

In a select scenario, the options are hidden with a primary focus to preserve space. In a radio scenario, the options are revealed for easy access. A radio scenario works best with limited options. A select scenario works in either situation but is often needed for lots of options.

So while HA might not differentiate between them as you seem to be indicating I think it should. There are different use cases where one option works better than another often dictated by the usage patterns on devices and space constraints.

brandensilva avatar Feb 18 '22 23:02 brandensilva

Yes. I understand what a radio and select is :)

In HA they are the same setup and it was more of a comment to the OP.

This is not a viable option without the option of choice. Meaning input_select entities can hold text that is very long. So you cant always go with this option. These should only be the choice of the user for this design and not automatically used.

I get what you are say haha

zsarnett avatar Feb 18 '22 23:02 zsarnett

Yeah I was explaining it out for him too. I'm well aware you are a developer and understand these concepts.

brandensilva avatar Feb 18 '22 23:02 brandensilva

Here's a visual for OP of the differences between a select dropdown and a radio input:

Select Dropdown (requires 2 interactions to make a selection): image

Radio Input (requires only 1 interaction to select a choice): image

HA doesn't differentiate between them it sounds like and treats them all as input_select but what you are looking for appears to be a radio-like input behavior with buttons instead of radio checkboxes that Zack demonstrated.

brandensilva avatar Feb 18 '22 23:02 brandensilva

I'd also add that a select input would work better in HA if it could be customized for taps over clicks. The default input selector isn't very great for mobile devices. It was built in a time when that didn't exist so if we can start adding mobile friendly customized dropdowns that have larger tap targets over the default HTML rendered ones that would help tremendously at making selections for mobile/tablet users.

Maybe some of this can move upstream and make it into HA. Zack would have better knowledge at working through that process of change but this would simplify the management of dealing with this situation instead of relying on card mods or custom cards.

The motto this year is all about streamlining experiences and this is one I'd like to see improved to aid in that goal.

brandensilva avatar Feb 18 '22 23:02 brandensilva

hello, I would also be interested in an input_select card, has there been anything new since? thank you

xekil avatar May 19 '22 07:05 xekil

an input_number card showing a slider like brightness in a light card would also be great.

TheFes avatar Jul 12 '22 13:07 TheFes

Implemented with select card.

piitaya avatar Dec 04 '23 10:12 piitaya