additional config validations
This commit is contained in:
@@ -41,6 +41,9 @@ function rtu.load_config()
|
||||
local cfv = util.new_validator()
|
||||
|
||||
cfv.assert_type_num(config.SpeakerVolume)
|
||||
cfv.assert_min(config.SpeakerVolume, 0.0)
|
||||
cfv.assert_max(config.SpeakerVolume, 3.0)
|
||||
|
||||
cfv.assert_channel(config.SVR_Channel)
|
||||
cfv.assert_channel(config.RTU_Channel)
|
||||
cfv.assert_type_num(config.ConnTimeout)
|
||||
@@ -55,6 +58,7 @@ function rtu.load_config()
|
||||
end
|
||||
|
||||
cfv.assert_type_int(config.LogMode)
|
||||
cfv.assert_range(config.LogMode, 0, 1)
|
||||
cfv.assert_type_str(config.LogPath)
|
||||
cfv.assert_type_bool(config.LogDebug)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user