Always send schedule

This commit is contained in:
Paul Tyng
2022-10-22 21:00:33 -04:00
parent 887fae8168
commit 0552712b3b
2 changed files with 10 additions and 1 deletions

View File

@@ -403,6 +403,15 @@ func main() {
} }
return nil return nil
} }
case "WLAN":
resource.FieldProcessor = func(name string, f *FieldInfo) error {
switch name {
case "ScheduleWithDuration":
// always send schedule, so we can empty it if we want to
f.OmitEmpty = false
}
return nil
}
} }
err = resource.processJSON(b) err = resource.processJSON(b)

View File

@@ -88,7 +88,7 @@ type WLAN struct {
Schedule []string `json:"schedule,omitempty"` // (sun|mon|tue|wed|thu|fri|sat)(\-(sun|mon|tue|wed|thu|fri|sat))?\|([0-2][0-9][0-5][0-9])\-([0-2][0-9][0-5][0-9]) Schedule []string `json:"schedule,omitempty"` // (sun|mon|tue|wed|thu|fri|sat)(\-(sun|mon|tue|wed|thu|fri|sat))?\|([0-2][0-9][0-5][0-9])\-([0-2][0-9][0-5][0-9])
ScheduleEnabled bool `json:"schedule_enabled"` ScheduleEnabled bool `json:"schedule_enabled"`
ScheduleReversed bool `json:"schedule_reversed"` ScheduleReversed bool `json:"schedule_reversed"`
ScheduleWithDuration []WLANScheduleWithDuration `json:"schedule_with_duration,omitempty"` ScheduleWithDuration []WLANScheduleWithDuration `json:"schedule_with_duration"`
Security string `json:"security,omitempty"` // open|wpapsk|wep|wpaeap|osen Security string `json:"security,omitempty"` // open|wpapsk|wep|wpaeap|osen
SettingPreference string `json:"setting_preference,omitempty"` // auto|manual SettingPreference string `json:"setting_preference,omitempty"` // auto|manual
TdlsProhibit bool `json:"tdls_prohibit"` TdlsProhibit bool `json:"tdls_prohibit"`