Device Driver UI inconsistency

What am I missing here to make the buttons all format the same (i.e. "Push", "Double Tap", "Triple Tap", "Quadruple Tap", "Quintuple Tap"):

command 'push', [ [ name: 'Button number to push *', type: 'ENUM', constraints: BUTTONS ] ]
command 'doubleTap', [ [ name: 'Button number to double tap *', type: 'ENUM', constraints: BUTTONS ] ]
command 'tripleTap', [ [ name: 'Button number to triple tap *', type: 'ENUM', constraints: BUTTONS ] ]
command 'quadrupleTap', [ [ name: 'Button number to quadruple tap *', type: 'ENUM', constraints: BUTTONS ] ]
command 'quintupleTap', [ [ name: 'Button number to quintuple tap *', type: 'ENUM', constraints: BUTTONS ] ]

Mu understanding is that the button name should use the command name split on capital letter, so "doubleTap" -> "Double Tap", "resetPreferencesToDefault" -> "Reset Preferences To Default"?

Why don't the triple / quadruple / quintuple ones work the same way?

Instead they show a "Run" button?

ENUM is giving you that dropdown for what should be a list of the constraints for your ENUM in the command.

You don't want ENUM, you just want a simple button, which means you just need a command method name and no type, since there is no input type to be had.

command "doubleTap"

will run method doubleTap() with a button on the device page.

Note: the official button capability for a double tap is "doubleTapped" if you wanted to stay with convention.

Edit: Oh, you probably want to have multiple button numbers. In that case you need ENUM

command "doubleTapped", [[name:"doubleTapped",type:"ENUM", description:"Double Tapped", constraints:["1","2","3","4"]]]

That will run doubleTapped(num) method, where you can evaluate what number was doubleTapped.

Thanks but that's not really the point here :slight_smile:

These are custom commands that I want to be an ENUM, because I want to limit the selection to the numbers in the list.

The question is why do the buttons on the UI not all format consistently as shown in the image.

The name / button name on the UI is supposed to come from the command name -

A command "resetPreferencesToDefault":


command 'resetPreferencesToDefault'

gives:

image

... both the name and the button name are generated based on the capital letter placement in the command.

A command "doubleTap":

command 'doubleTap', [ [ name: 'Button number to double tap *', type: 'ENUM', constraints: BUTTONS ] ]

gives:

image

... and is also correct, both name ("Double Tap") and button name ("Double Tap") are correct.

This however, gives the correct name ("Quadruple Tap"), but does not give the correct button name ("Run"):

command 'quadrupleTap', [ [ name: 'Button number to quadruple tap *', type: 'ENUM', constraints: BUTTONS ] ]

image

... it has a button named "Run" instead of "Quadruple Tap".

Obviously it's only a cosmetic thing, but IMO the behaviour should be consistent.

1 Like

Oh, sorry, I guess I totally missed what you were asking.

Are you using the the DoubleTapableButton capabitlity in the driver? I know in my button devices it puts the name on the button itself for that capability. Tripple Tapable is not a Hubitat capability, so I think that is why you get run on the button there, just like any other custom command that is not part of a capability.

I think it's a UI bug around "command" formatting for ENUM rather than anything tied to capabilities.

It doesn't really matter what the command name is, the behaviour is the same:

command 'hubitatIsAwesome', [ [ name: 'Button number to quadruple tap *', type: 'ENUM', constraints: BUTTONS ] ]

Gives name "Hubitat Is Awesome" (expected) and a button name "Run" (IMO unexpected).

image

Whereas:

command 'hubitatIsAwesome'

Gives consistent name / button name:

image

It's inconsistent with some of the "built in" commands too:

image

Shows name "Set Level" and a button name "Set".

image

Shows name "Flash" and a button name "Run".

As I said, it's only cosmetic so doesn't impact any functionality .....

Still seems capability related. Any simple command for me always labels the button as the command name, so hubitatIsAwsome follows that. hubitatIsAwsome(num) shows the run button like any non-capability command seems to.

setLevel is a capability, so it has a set button (but why is it not labeled Set Level is a mystery).

Flash implements either flash() or flash(rate), since rateToFlash is an optional parameter. That might explain why that capability specifically gets just run on the button like any non capability command.

1 Like