Validation check for config parameters
Posted: 30 Jan 2019 05:59
Hello,
Per the current documentation, Z-Wave configuration parameters are saved to the EEPROM automatically. However, this would seem to not allow the application of any validation rules. For example, if I need a parameter that only allows a valid range for 0 to 5 (just an example). How could I block values outside of that range from being saved to the EEPROM?
Is it valid (allowed within Z-Wave) to use the ZUNO_SETUP_CFGPARAMETER_HANDLER(config_parameter_changed) handler, to overwrite the EEPROM parameter back to the previous value, if the newly received value was out of range? This would seem to create a loop between many controllers that will "keep trying" to write the parameter into the "new" value, since they wouldn't know anything about the allowed range / values.
Cheers,
Lincoln
Per the current documentation, Z-Wave configuration parameters are saved to the EEPROM automatically. However, this would seem to not allow the application of any validation rules. For example, if I need a parameter that only allows a valid range for 0 to 5 (just an example). How could I block values outside of that range from being saved to the EEPROM?
Is it valid (allowed within Z-Wave) to use the ZUNO_SETUP_CFGPARAMETER_HANDLER(config_parameter_changed) handler, to overwrite the EEPROM parameter back to the previous value, if the newly received value was out of range? This would seem to create a loop between many controllers that will "keep trying" to write the parameter into the "new" value, since they wouldn't know anything about the allowed range / values.
Cheers,
Lincoln