From d80ad93a17d4ee48186e554f19d072f612f8bc44 Mon Sep 17 00:00:00 2001 From: davidnewhall2 Date: Mon, 8 Jul 2019 00:46:30 -0700 Subject: [PATCH] stop overriding false txt --- core/unifi/types.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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") ||