First, you don't *have* to assign valid values to a Property. You can leave it open to accept any value. To help the user you should/could give the Property a list of valid values. These values still don't restrict the user from entering other values, but it helps in picking values in the UI.ericvic wrote:how to I add what the valid values are for a property? i.e. I'm going to have a fan property that should have 'on' and 'auto'.
Also, if you are going to add values, you shouldn't use a stock Property (as I described in a previous message). When you add the valid values to a Property, it effects all Devices that use that Property. Therefore you should create your own Property as I described before.
pHB_CreateDevicePropertyValue(...) is what you are looking for. It will add a valid value to a Property. You have to call it once for each value.
Code: Select all
m_CallBackInfo.pHB_CreateDevicePropertyValue( "Fan", "On" );
m_CallBackInfo.pHB_CreateDevicePropertyValue( "Fan", "Auto" );