diff --git a/core/unifi/types.go b/core/unifi/types.go index 46dc652f..9d668543 100644 --- a/core/unifi/types.go +++ b/core/unifi/types.go @@ -102,9 +102,7 @@ type FlexBool struct { // UnmarshalJSON method converts armed/disarmed, yes/no, active/inactive or 0/1 to true/false. // Really it converts ready, ok, up, t, armed, yes, active, enabled, 1, true to true. Anything else is false. func (f *FlexBool) UnmarshalJSON(b []byte) error { - if f.Txt = strings.Trim(string(b), `"`); f.Txt == "" { - f.Txt = "false" - } + f.Txt = strings.Trim(string(b), `"`) f.Val = f.Txt == "1" || strings.EqualFold(f.Txt, "true") || strings.EqualFold(f.Txt, "yes") || strings.EqualFold(f.Txt, "t") || strings.EqualFold(f.Txt, "armed") || strings.EqualFold(f.Txt, "active") || strings.EqualFold(f.Txt, "enabled") || strings.EqualFold(f.Txt, "ready") || strings.EqualFold(f.Txt, "up") ||