additional config validations

This commit is contained in:
Mikayla Fischler
2024-02-18 15:25:30 -05:00
parent 36b12d5dea
commit 1984b63837
5 changed files with 12 additions and 2 deletions

View File

@@ -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)