Skip to Content
0
May 26, 2010 at 12:23 PM

How does the $set_default assignment work in procedures?

483 Views

Thanks in advance for your time and responses. I have a specific question about setting a default characteristic value. If you set a default in the characteristic, the user is able to deselect the default in configuration. However, I would like to set a default based on other selections and still give the user the option to deselect this default. I have setup a procedure on the profile with the following code:

$set_default($self, alarm, 'green') if $self.temperature > 80.

In configuration cu50, the alarm characteristic is set to green by default at the proper time, however the user is not able to deselect the default green. The characteristic is not required and there is no other logic for this characteristic in the profile. Am I missing something here or is this the way it works?