Scott,
I've been creating properties in my plug-ins using the example you gave me a while back but now I need to create a property that has a range of 0-100 and I don't really want to enter gCallBackInfo.pHB_CreateDevicePropertyValue() 100 times. Is there a way to create a range of valid values?
Thanks,
Eric
Creating Properties
Scott,
Another question. I'm trying to reset a property to No during the processing when it is being set to Yes (like your messagebox example and I'm doing this:
It doesn't work. Can you see what I'm doing wrong?
Thanks,
Eric
Another question. I'm trying to reset a property to No during the processing when it is being set to Yes (like your messagebox example and I'm doing this:
Code: Select all
if ((pChangedValue->GetOwningProperty() == mGetStatus) &&
(0 == strcmp( pChangedValue->GetPropertyValue(), "Yes")))
{
SendX10(mHouseCode->GetPropertyValueAsString(), mUnitCode->GetPropertyValueAsString(), "Status Request", 0);
// Now change the value back to "No".
CPropertyValue* pNoValue = mGetStatus->CreatePropertyValue("No");
if (pNoValue)
{
pNoValue->ChangeRequestCompleted();
delete pNoValue;
}
}
Thanks,
Eric
Eric,
The code looks fine to me.
Check out the "History" tab for the property to make sure that it is indeed NOT getting reset to "No".
I just fixed a bug in the sample MessageBox Device where the Device was changing the value to "No", but then after that resetting it back to "Yes" by committing the original Property Change request.
The code looks fine to me.
Check out the "History" tab for the property to make sure that it is indeed NOT getting reset to "No".
I just fixed a bug in the sample MessageBox Device where the Device was changing the value to "No", but then after that resetting it back to "Yes" by committing the original Property Change request.
Scott
Don't just delete it. It will cause a memory leak.
If using the CPropertyValue class, you can call:
If you're not using the CPropertyValue class, there are also equivalent callback functions in the raw API.
If using the CPropertyValue class, you can call:
- ChangeRequestCompleted - Which will make the change stick.
- ChangeRequestFailed - Which will not make the change stick and probably display an error of some kind.
- ChangeRequestAbandoned - This just drops it. I think this is what you want, but I don't know off the top of my head what state it will leave the value in. I don't know if it will roll it back, or just leave it.
If you're not using the CPropertyValue class, there are also equivalent callback functions in the raw API.
Scott