Closed thomasloven closed 5 years ago
I agree that we should homogenize (what a word). But I also think that we should wait for UI to pan out a bit more.
Then I want to see if we can make it as similar across the board as possible. Maybe even enforce it by routing it all through the same helper, so we enforce same config.
Let's toss this in here as well: https://github.com/home-assistant/ui-schema/issues/191 once we are out of our feature freeze
Work is ongoing home-assistant/home-assistant-polymer#2182
Updated table:
more-info |
toggle |
call-service |
navigate |
long-press | |
---|---|---|---|---|---|
picture-elements |
X | X | X | X | X |
(service-button) |
X | ||||
(state-badge) |
|||||
entities |
X | ||||
glance |
X | X | X | X | X |
entity-button |
X | X | X | X | X |
light |
X | X | |||
picture |
X | X | X | X | X |
picture-entity |
X | X | X | X | X |
picture-glance |
* | * | * | * | * |
sensor |
X |
Everything that makes sense to use long-press now uses long-press (with possible exception of entities
card), and thus supports all actions.
I'd call this done and will close the issue.
Edit: Note: the "glance part" of picture-glance
card doesn't support all actions (as glance
card does). May seem strange, but I think it makes sense, and there are ways to do things differently if you want (picture-elements
).
Different cards and elements allow different
tap_actions
.The currently available actions are
more-info
toggle
call-service
navigate
Currently:
more-info
toggle
call-service
navigate
picture-elements
(service-button)
(state-badge)
entities
glance
entity-button
light
picture
picture-entity
picture-glance
sensor
picture-elements
elements support all actions exceptservice-button
which only calls servicesstate-badge
which isn't clickableentities
card is locked tomore-info
glance
card supports all butnavigate
entity-button
card supports all butnavigate
light
card is locked totoggle
andmore-info
picture
card supportsnavigate
andcall-service
but with a different configuration method (!)picture-entity
card supportstoggle
andmore-info
picture-glance
card supportsnavigate
andmore-info
(for cameras) but with a different configuration method (!) Icons are locked tomore-info
ortoggle
depending on typesensor
card is locked tomore-info
I may have missed something. This list is just from looking at the source, not testing...
Configuration is performed by setting the value of
tap_action
except in the case ofpicture
andpicture-glance
card wherenavigate
is used ifnavigation-path
is set, andmore-info
is used if the picture source is a camera.Regarding
call-service
allpicture-elements
elements addentity_id:
to the data passed to the service. This limits the available services.All this (except
picture
,picture-glance
,sensor
) applies tohold_action
as well.Some of the discrepancies makes sense (
light
card shouldn't be expected to work any other way) but some should probably be looked over.Related
191
200