AlexxIT/go2rtc · error
wyze: failed to parse device list
Error message
wyze: failed to parse device list: %w
What it means
The Wyze device-list endpoint returned JSON that could not be unmarshaled into deviceListResponse, so GetCameraList cannot enumerate cameras. Wraps the unmarshal error; also breaks GetCamera, which calls it lazily.
Solutions
- Retry the request
- Update deviceListResponse to match the current Wyze API schema
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at pkg/wyze/cloud.go:187 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of AlexxIT/go2rtc@c245815e75 (2026-09-07).
Data as JSON: /api/errors/28f40186104c28c4.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/wyze/cloud.go:187
if err != nil {
return nil, err
}
req.Header.Set("Content-Type", "application/json")
resp, err := c.client.Do(req)
if err != nil {
return nil, err
}
defer resp.Body.Close()
body, err := io.ReadAll(resp.Body)
if err != nil {
return nil, err
}
var result deviceListResponse
if err := json.Unmarshal(body, &result); err != nil {
return nil, fmt.Errorf("wyze: failed to parse device list: %w", err)
}
if result.Code != "1" {
return nil, fmt.Errorf("wyze: API error: %s - %s", result.Code, result.Msg)
}
c.cameras = nil
for _, dev := range result.Data.DeviceList {
if dev.ProductType != "Camera" {
continue
}
if dev.DeviceParams.IP == "" {
continue // skip cameras without IP (gwell protocol)
}
c.cameras = append(c.cameras, &Camera{
MAC: dev.MAC,
P2PID: dev.DeviceParams.P2PID,View on GitHub (pinned to c245815e75)