From c78ca38de76952f54e1cf8ddc86593cbd905ae15 Mon Sep 17 00:00:00 2001 From: Allan Nava Date: Tue, 31 Jan 2023 15:43:45 +0100 Subject: [PATCH] fix builder.go --- haivision/builder.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/haivision/builder.go b/haivision/builder.go index bfa2590..1da5073 100644 --- a/haivision/builder.go +++ b/haivision/builder.go @@ -39,12 +39,14 @@ func BuildHaivision(url string, debug bool, username string, password string, he Value: respSessionId.Response.SessionID, }) // - deviceResponse, err = haivisionClient.GetDeviceInfo() + deviceResponse, err := haivisionClient.GetDeviceInfo() if err != nil { return nil, err } - o.DeviceID = deviceResponse.ID - o.HType = deviceResponse.Type + if len(deviceResponse.Responses) > 0 { + haivisionClient.DeviceID = deviceResponse.Responses[0].ID + haivisionClient.HType = deviceResponse.Responses[0].Type + } // if header != nil { // Headers for all request