Custom Capability: Create Event or Create Setter to update Attributes?

Hi all,

I am trying to create a custom capability using the cli. During the creation of the capability using the command smartthings capabilities:create it asks if I would like to add a setter command for this attribute.

I assume this setter command is for a user setting a value. For example the attribute I am creating is for a value of electrical current. The user would not set this, it would be updated by the device handler.

The usual way I update an attribute value is by creating an event however is there an easier way now possibly using a setter method this way?

What is the recommended way for updating attributes of a custom capability?

For a device with the Switch capability, you can control the device using the separate on() and off() commands that typically result in the switch attribute being on or off. There isn’t a ‘setter command’.

For a device with the Thermostat Cooling Setpoint capability, you can control the device using the single setCoolingSetpoint() command that results in the coolingSetpoint attribute being set to a specified value. The setCoolingSetpoint() command is termed the ‘setter command’.

So nothing is changed about how attributes are set.

I’d like to explain why the concept of a ‘setter command’ is even a thing, but I have absolutely no idea.

Maybe that is indeed the intent of it, but the existence of a ‘setter command’ doesn’t seem to add any obvious value in practice. For example, the Thermostat Cooling Setpoint capability presentation explicitly refers to setCoolingSetpoint in the detail view ‘slider’ and automation ‘numberfield’ types, it isn’t defaulting to the ‘setter command’ anywhere.